Go to the source code of this file.
|
static void | clib_mem_set_thread_index (void) |
|
static void * | clib_mem_get_per_cpu_heap (void) |
|
static void * | clib_mem_set_per_cpu_heap (u8 *new_heap) |
|
static void * | clib_mem_alloc_aligned_at_offset (uword size, uword align, uword align_offset, int os_out_of_memory_on_failure) |
|
static void * | clib_mem_alloc (uword size) |
|
static void * | clib_mem_alloc_aligned (uword size, uword align) |
|
static void * | clib_mem_alloc_or_null (uword size) |
|
static void * | clib_mem_alloc_aligned_or_null (uword size, uword align) |
|
static uword | clib_mem_is_heap_object (void *p) |
|
static void | clib_mem_free (void *p) |
|
static void * | clib_mem_realloc (void *p, uword new_size, uword old_size) |
|
static uword | clib_mem_size (void *p) |
|
static void | clib_mem_free_s (void *p) |
|
static void * | clib_mem_get_heap (void) |
|
static void * | clib_mem_set_heap (void *heap) |
|
void * | clib_mem_init (void *heap, uword size) |
|
void * | clib_mem_init_thread_safe (void *memory, uword memory_size) |
|
void | clib_mem_exit (void) |
|
uword | clib_mem_get_page_size (void) |
|
void | clib_mem_validate (void) |
|
void | clib_mem_trace (int enable) |
|
int | clib_mem_is_traced (void) |
|
void | clib_mem_usage (clib_mem_usage_t *usage) |
|
u8 * | format_clib_mem_usage (u8 *s, va_list *args) |
|
static void * | clib_mem_vm_alloc (uword size) |
|
static void | clib_mem_vm_free (void *addr, uword size) |
|
static void * | clib_mem_vm_unmap (void *addr, uword size) |
|
static void * | clib_mem_vm_map (void *addr, uword size) |
|
clib_error_t * | clib_mem_create_fd (char *name, int *fdp) |
|
clib_error_t * | clib_mem_create_hugetlb_fd (char *name, int *fdp) |
|
clib_error_t * | clib_mem_vm_ext_alloc (clib_mem_vm_alloc_t *a) |
|
void | clib_mem_vm_ext_free (clib_mem_vm_alloc_t *a) |
|
u64 | clib_mem_get_fd_page_size (int fd) |
|
uword | clib_mem_get_default_hugepage_size (void) |
|
int | clib_mem_get_fd_log2_page_size (int fd) |
|
u64 * | clib_mem_vm_get_paddr (void *mem, int log2_page_size, int n_pages) |
|
clib_error_t * | clib_mem_vm_ext_map (clib_mem_vm_map_t *a) |
|
void | clib_mem_vm_randomize_va (uword *requested_va, u32 log2_page_size) |
|
void | mheap_trace (void *v, int enable) |
|
uword | clib_mem_trace_enable_disable (uword enable) |
|
◆ CLIB_MAX_MHEAPS
#define CLIB_MAX_MHEAPS 256 |
Definition at line 58 of file mem.h.
◆ clib_mem_alloc_aligned_no_fail
#define clib_mem_alloc_aligned_no_fail |
( |
|
size, |
|
|
|
align |
|
) |
| |
Value:({ \
uword _clib_mem_alloc_size = (
size); \
void * _clib_mem_alloc_p; \
if (! _clib_mem_alloc_p) \
clib_panic ("failed to allocate %d bytes", _clib_mem_alloc_size); \
_clib_mem_alloc_p; \
})
static void * clib_mem_alloc_aligned(uword size, uword align)
Definition at line 187 of file mem.h.
◆ clib_mem_alloc_no_fail
◆ clib_mem_alloc_stack
#define clib_mem_alloc_stack |
( |
|
bytes | ) |
__builtin_alloca(bytes) |
◆ CLIB_MEM_VM_F_HUGETLB
#define CLIB_MEM_VM_F_HUGETLB (1 << 1) |
◆ CLIB_MEM_VM_F_HUGETLB_PREALLOC
#define CLIB_MEM_VM_F_HUGETLB_PREALLOC (1 << 4) |
◆ CLIB_MEM_VM_F_LOCKED
#define CLIB_MEM_VM_F_LOCKED (1 << 5) |
◆ CLIB_MEM_VM_F_NUMA_FORCE
#define CLIB_MEM_VM_F_NUMA_FORCE (1 << 3) |
◆ CLIB_MEM_VM_F_NUMA_PREFER
#define CLIB_MEM_VM_F_NUMA_PREFER (1 << 2) |
◆ CLIB_MEM_VM_F_SHARED
#define CLIB_MEM_VM_F_SHARED (1 << 0) |
◆ clib_mem_alloc()
static void* clib_mem_alloc |
( |
uword |
size | ) |
|
|
inlinestatic |
◆ clib_mem_alloc_aligned()
static void* clib_mem_alloc_aligned |
( |
uword |
size, |
|
|
uword |
align |
|
) |
| |
|
inlinestatic |
◆ clib_mem_alloc_aligned_at_offset()
static void* clib_mem_alloc_aligned_at_offset |
( |
uword |
size, |
|
|
uword |
align, |
|
|
uword |
align_offset, |
|
|
int |
os_out_of_memory_on_failure |
|
) |
| |
|
inlinestatic |
◆ clib_mem_alloc_aligned_or_null()
static void* clib_mem_alloc_aligned_or_null |
( |
uword |
size, |
|
|
uword |
align |
|
) |
| |
|
inlinestatic |
◆ clib_mem_alloc_or_null()
static void* clib_mem_alloc_or_null |
( |
uword |
size | ) |
|
|
inlinestatic |
◆ clib_mem_create_fd()
◆ clib_mem_create_hugetlb_fd()
clib_error_t* clib_mem_create_hugetlb_fd |
( |
char * |
name, |
|
|
int * |
fdp |
|
) |
| |
◆ clib_mem_exit()
void clib_mem_exit |
( |
void |
| ) |
|
◆ clib_mem_free()
static void clib_mem_free |
( |
void * |
p | ) |
|
|
inlinestatic |
◆ clib_mem_free_s()
static void clib_mem_free_s |
( |
void * |
p | ) |
|
|
inlinestatic |
◆ clib_mem_get_default_hugepage_size()
uword clib_mem_get_default_hugepage_size |
( |
void |
| ) |
|
Definition at line 57 of file mem.c.
◆ clib_mem_get_fd_log2_page_size()
int clib_mem_get_fd_log2_page_size |
( |
int |
fd | ) |
|
◆ clib_mem_get_fd_page_size()
u64 clib_mem_get_fd_page_size |
( |
int |
fd | ) |
|
Definition at line 91 of file mem.c.
◆ clib_mem_get_heap()
static void* clib_mem_get_heap |
( |
void |
| ) |
|
|
inlinestatic |
◆ clib_mem_get_page_size()
uword clib_mem_get_page_size |
( |
void |
| ) |
|
Definition at line 51 of file mem.c.
◆ clib_mem_get_per_cpu_heap()
static void* clib_mem_get_per_cpu_heap |
( |
void |
| ) |
|
|
inlinestatic |
Definition at line 85 of file mem.h.
◆ clib_mem_init()
void* clib_mem_init |
( |
void * |
heap, |
|
|
uword |
size |
|
) |
| |
◆ clib_mem_init_thread_safe()
void* clib_mem_init_thread_safe |
( |
void * |
memory, |
|
|
uword |
memory_size |
|
) |
| |
◆ clib_mem_is_heap_object()
static uword clib_mem_is_heap_object |
( |
void * |
p | ) |
|
|
inlinestatic |
◆ clib_mem_is_traced()
int clib_mem_is_traced |
( |
void |
| ) |
|
◆ clib_mem_realloc()
static void* clib_mem_realloc |
( |
void * |
p, |
|
|
uword |
new_size, |
|
|
uword |
old_size |
|
) |
| |
|
inlinestatic |
◆ clib_mem_set_heap()
static void* clib_mem_set_heap |
( |
void * |
heap | ) |
|
|
inlinestatic |
◆ clib_mem_set_per_cpu_heap()
static void* clib_mem_set_per_cpu_heap |
( |
u8 * |
new_heap | ) |
|
|
inlinestatic |
Definition at line 92 of file mem.h.
◆ clib_mem_set_thread_index()
static void clib_mem_set_thread_index |
( |
void |
| ) |
|
|
inlinestatic |
Definition at line 64 of file mem.h.
◆ clib_mem_size()
static uword clib_mem_size |
( |
void * |
p | ) |
|
|
inlinestatic |
◆ clib_mem_trace()
void clib_mem_trace |
( |
int |
enable | ) |
|
◆ clib_mem_trace_enable_disable()
uword clib_mem_trace_enable_disable |
( |
uword |
enable | ) |
|
◆ clib_mem_usage()
◆ clib_mem_validate()
void clib_mem_validate |
( |
void |
| ) |
|
◆ clib_mem_vm_alloc()
static void* clib_mem_vm_alloc |
( |
uword |
size | ) |
|
|
inlinestatic |
◆ clib_mem_vm_ext_alloc()
◆ clib_mem_vm_ext_free()
◆ clib_mem_vm_ext_map()
◆ clib_mem_vm_free()
static void clib_mem_vm_free |
( |
void * |
addr, |
|
|
uword |
size |
|
) |
| |
|
inlinestatic |
◆ clib_mem_vm_get_paddr()
u64* clib_mem_vm_get_paddr |
( |
void * |
mem, |
|
|
int |
log2_page_size, |
|
|
int |
n_pages |
|
) |
| |
◆ clib_mem_vm_map()
static void* clib_mem_vm_map |
( |
void * |
addr, |
|
|
uword |
size |
|
) |
| |
|
inlinestatic |
◆ clib_mem_vm_randomize_va()
void clib_mem_vm_randomize_va |
( |
uword * |
requested_va, |
|
|
u32 |
log2_page_size |
|
) |
| |
◆ clib_mem_vm_unmap()
static void* clib_mem_vm_unmap |
( |
void * |
addr, |
|
|
uword |
size |
|
) |
| |
|
inlinestatic |
◆ format_clib_mem_usage()
u8* format_clib_mem_usage |
( |
u8 * |
s, |
|
|
va_list * |
args |
|
) |
| |
◆ mheap_trace()
void mheap_trace |
( |
void * |
v, |
|
|
int |
enable |
|
) |
| |
◆ clib_per_cpu_mheaps