FD.io VPP  v16.06
Vector Packet Processing
mem.h File Reference
+ Include dependency graph for mem.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  clib_mem_usage_t
 

Macros

#define CLIB_MAX_MHEAPS   256
 
#define clib_mem_alloc_aligned_no_fail(size, align)
 
#define clib_mem_alloc_no_fail(size)   clib_mem_alloc_aligned_no_fail(size,1)
 
#define clib_mem_alloc_stack(bytes)   __builtin_alloca(bytes)
 

Functions

always_inline voidclib_mem_get_per_cpu_heap (void)
 
always_inline voidclib_mem_set_per_cpu_heap (u8 *new_heap)
 
always_inline voidclib_mem_alloc_aligned_at_offset (uword size, uword align, uword align_offset)
 
always_inline voidclib_mem_alloc (uword size)
 
always_inline voidclib_mem_alloc_aligned (uword size, uword align)
 
always_inline uword clib_mem_is_heap_object (void *p)
 
always_inline void clib_mem_free (void *p)
 
always_inline voidclib_mem_realloc (void *p, uword new_size, uword old_size)
 
always_inline uword clib_mem_size (void *p)
 
always_inline voidclib_mem_get_heap (void)
 
always_inline voidclib_mem_set_heap (void *heap)
 
voidclib_mem_init (void *heap, uword size)
 
void clib_mem_exit (void)
 
uword clib_mem_get_page_size (void)
 
void clib_mem_validate (void)
 
void clib_mem_trace (int enable)
 
void clib_mem_usage (clib_mem_usage_t *usage)
 
u8format_clib_mem_usage (u8 *s, va_list *args)
 

Variables

voidclib_per_cpu_mheaps [CLIB_MAX_MHEAPS]
 

Macro Definition Documentation

#define CLIB_MAX_MHEAPS   256

Definition at line 49 of file mem.h.

#define clib_mem_alloc_aligned_no_fail (   size,
  align 
)
Value:
({ \
uword _clib_mem_alloc_size = (size); \
void * _clib_mem_alloc_p; \
_clib_mem_alloc_p = clib_mem_alloc_aligned (_clib_mem_alloc_size, (align)); \
if (! _clib_mem_alloc_p) \
clib_panic ("failed to allocate %d bytes", _clib_mem_alloc_size); \
_clib_mem_alloc_p; \
})
static void(BVT(clib_bihash)*h, BVT(clib_bihash_value)*v)
always_inline void * clib_mem_alloc_aligned(uword size, uword align)
Definition: mem.h:113
u32 size
Definition: vhost-user.h:74
u64 uword
Definition: types.h:112
#define clib_panic(format, args...)
Definition: error.h:72

Definition at line 118 of file mem.h.

#define clib_mem_alloc_no_fail (   size)    clib_mem_alloc_aligned_no_fail(size,1)

Definition at line 128 of file mem.h.

#define clib_mem_alloc_stack (   bytes)    __builtin_alloca(bytes)

Definition at line 131 of file mem.h.

Function Documentation

always_inline void* clib_mem_alloc ( uword  size)

Definition at line 109 of file mem.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void* clib_mem_alloc_aligned ( uword  size,
uword  align 
)

Definition at line 113 of file mem.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void* clib_mem_alloc_aligned_at_offset ( uword  size,
uword  align,
uword  align_offset 
)

Definition at line 70 of file mem.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void clib_mem_exit ( void  )

Definition at line 55 of file mem_mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void clib_mem_free ( void p)

Definition at line 149 of file mem.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void* clib_mem_get_heap ( void  )

Definition at line 187 of file mem.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uword clib_mem_get_page_size ( void  )

Definition at line 111 of file mem_mheap.c.

+ Here is the caller graph for this function:

always_inline void* clib_mem_get_per_cpu_heap ( void  )

Definition at line 54 of file mem.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void* clib_mem_init ( void heap,
uword  size 
)

Definition at line 65 of file mem_mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline uword clib_mem_is_heap_object ( void p)

Definition at line 133 of file mem.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void* clib_mem_realloc ( void p,
uword  new_size,
uword  old_size 
)

Definition at line 163 of file mem.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void* clib_mem_set_heap ( void heap)

Definition at line 190 of file mem.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void* clib_mem_set_per_cpu_heap ( u8 new_heap)

Definition at line 60 of file mem.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline uword clib_mem_size ( void p)

Definition at line 180 of file mem.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void clib_mem_trace ( int  enable)

Definition at line 144 of file mem_mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void clib_mem_usage ( clib_mem_usage_t usage)

Definition at line 127 of file mem_mheap.c.

+ Here is the call graph for this function:

void clib_mem_validate ( void  )

Definition at line 133 of file mem_mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_clib_mem_usage ( u8 s,
va_list *  args 
)

Definition at line 121 of file mem_mheap.c.

+ Here is the call graph for this function:

Variable Documentation

void* clib_per_cpu_mheaps[CLIB_MAX_MHEAPS]

Definition at line 53 of file mem_mheap.c.