FD.io VPP  v17.01-9-ge7dcee4
Vector Packet Processing
mheap.c File Reference
+ Include dependency graph for mheap.c:

Go to the source code of this file.

Macros

#define MHEAP_VM_MAP   (1 << 0)
 
#define MHEAP_VM_UNMAP   (1 << 1)
 
#define MHEAP_VM_NOMAP   (0 << 1)
 
#define MHEAP_VM_ROUND   (1 << 2)
 
#define MHEAP_VM_ROUND_UP   MHEAP_VM_ROUND
 
#define MHEAP_VM_ROUND_DOWN   (0 << 2)
 
#define CHECK(x)   if (! (x)) { mheap_validate_breakpoint (); os_panic (); }
 

Functions

static void mheap_get_trace (void *v, uword offset, uword size)
 
static void mheap_put_trace (void *v, uword offset, uword size)
 
static int mheap_trace_sort (const void *t1, const void *t2)
 
static void mheap_maybe_lock (void *v)
 
static void mheap_maybe_unlock (void *v)
 
static uword user_data_size_to_bin_index (uword n_user_data_bytes)
 
static uword mheap_elt_size_to_user_n_bytes (uword n_bytes)
 
static uword mheap_elt_size_to_user_n_words (uword n_bytes)
 
static void mheap_elt_set_size (void *v, uword uoffset, uword n_user_data_bytes, uword is_free)
 
static void set_first_free_elt_offset (mheap_t *h, uword bin, uword uoffset)
 
static void set_free_elt (void *v, uword uoffset, uword n_user_data_bytes)
 
static void new_free_elt (void *v, uword uoffset, uword n_user_data_bytes)
 
static void remove_free_elt (void *v, mheap_elt_t *e, uword bin)
 
static void remove_free_elt2 (void *v, mheap_elt_t *e)
 
static_always_inline uword mheap_page_round (uword addr)
 
static_always_inline uword mheap_page_truncate (uword addr)
 
static_always_inline uword mheap_vm (void *v, uword flags, clib_address_t start_addr, uword size)
 
static_always_inline uword mheap_vm_elt (void *v, uword flags, uword offset)
 
static uword mheap_small_object_cache_mask (mheap_small_object_cache_t *c, uword bin)
 
static uword mheap_get_small_object (mheap_t *h, uword bin)
 
static uword mheap_put_small_object (mheap_t *h, uword bin, uword offset)
 
static uword mheap_get_search_free_bin (void *v, uword bin, uword *n_user_data_bytes_arg, uword align, uword align_offset)
 
static uword mheap_get_search_free_list (void *v, uword *n_user_bytes_arg, uword align, uword align_offset)
 
static never_inline void * mheap_get_extend_vector (void *v, uword n_user_data_bytes, uword align, uword align_offset, uword *offset_return)
 
void * mheap_get_aligned (void *v, uword n_user_data_bytes, uword align, uword align_offset, uword *offset_return)
 
static void free_last_elt (void *v, mheap_elt_t *e)
 
void mheap_put (void *v, uword uoffset)
 
void * mheap_alloc_with_flags (void *memory, uword memory_size, uword flags)
 
void * mheap_alloc (void *memory, uword size)
 
void mheap_foreach (void *v, uword(*func)(void *arg, void *v, void *elt_data, uword elt_size), void *arg)
 
static uword mheap_bytes_overhead (void *v)
 
uword mheap_bytes (void *v)
 
static void mheap_usage_no_lock (void *v, clib_mem_usage_t *usage)
 
void mheap_usage (void *v, clib_mem_usage_t *usage)
 
static u8format_mheap_byte_count (u8 *s, va_list *va)
 
static mheap_elt_tmheap_first_corrupt (void *v)
 
static u8format_mheap_stats (u8 *s, va_list *va)
 
u8format_mheap (u8 *s, va_list *va)
 
void dmh (void *v)
 
static void mheap_validate_breakpoint ()
 
void mheap_validate (void *v)
 
static void mheap_trace_main_free (mheap_trace_main_t *tm)
 
void mheap_trace (void *v, int enable)
 

Variables

static uword mheap_page_size
 

Macro Definition Documentation

#define CHECK (   x)    if (! (x)) { mheap_validate_breakpoint (); os_panic (); }
#define MHEAP_VM_MAP   (1 << 0)

Definition at line 236 of file mheap.c.

#define MHEAP_VM_NOMAP   (0 << 1)

Definition at line 238 of file mheap.c.

#define MHEAP_VM_ROUND   (1 << 2)

Definition at line 239 of file mheap.c.

#define MHEAP_VM_ROUND_DOWN   (0 << 2)

Definition at line 241 of file mheap.c.

#define MHEAP_VM_ROUND_UP   MHEAP_VM_ROUND

Definition at line 240 of file mheap.c.

#define MHEAP_VM_UNMAP   (1 << 1)

Definition at line 237 of file mheap.c.

Function Documentation

void dmh ( void *  v)

Definition at line 1332 of file mheap.c.

+ Here is the call graph for this function:

u8* format_mheap ( u8 s,
va_list *  va 
)

Definition at line 1168 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_mheap_byte_count ( u8 s,
va_list *  va 
)
static

Definition at line 1086 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_mheap_stats ( u8 s,
va_list *  va 
)
static

Definition at line 1125 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void free_last_elt ( void *  v,
mheap_elt_t e 
)
static

Definition at line 733 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void* mheap_alloc ( void *  memory,
uword  size 
)

Definition at line 953 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void* mheap_alloc_with_flags ( void *  memory,
uword  memory_size,
uword  flags 
)

Definition at line 875 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uword mheap_bytes ( void *  v)

Definition at line 1036 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword mheap_bytes_overhead ( void *  v)
inlinestatic

Definition at line 1028 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void mheap_elt_set_size ( void *  v,
uword  uoffset,
uword  n_user_data_bytes,
uword  is_free 
)
inlinestatic

Definition at line 134 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword mheap_elt_size_to_user_n_bytes ( uword  n_bytes)
inlinestatic

Definition at line 119 of file mheap.c.

+ Here is the caller graph for this function:

static uword mheap_elt_size_to_user_n_words ( uword  n_bytes)
inlinestatic

Definition at line 126 of file mheap.c.

+ Here is the call graph for this function:

static mheap_elt_t* mheap_first_corrupt ( void *  v)
static

Definition at line 1097 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mheap_foreach ( void *  v,
uword(*)(void *arg, void *v, void *elt_data, uword elt_size)  func,
void *  arg 
)

Definition at line 981 of file mheap.c.

+ Here is the call graph for this function:

void* mheap_get_aligned ( void *  v,
uword  n_user_data_bytes,
uword  align,
uword  align_offset,
uword offset_return 
)

Definition at line 649 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static never_inline void* mheap_get_extend_vector ( void *  v,
uword  n_user_data_bytes,
uword  align,
uword  align_offset,
uword offset_return 
)
static

Definition at line 575 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword mheap_get_search_free_bin ( void *  v,
uword  bin,
uword n_user_data_bytes_arg,
uword  align,
uword  align_offset 
)
static

Definition at line 375 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword mheap_get_search_free_list ( void *  v,
uword n_user_bytes_arg,
uword  align,
uword  align_offset 
)
static

Definition at line 517 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword mheap_get_small_object ( mheap_t h,
uword  bin 
)
inlinestatic

Definition at line 325 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void mheap_get_trace ( void *  v,
uword  offset,
uword  size 
)
static

Definition at line 1496 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void mheap_maybe_lock ( void *  v)
inlinestatic

Definition at line 54 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void mheap_maybe_unlock ( void *  v)
inlinestatic

Definition at line 75 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static_always_inline uword mheap_page_round ( uword  addr)

Definition at line 246 of file mheap.c.

+ Here is the caller graph for this function:

static_always_inline uword mheap_page_truncate ( uword  addr)

Definition at line 252 of file mheap.c.

+ Here is the caller graph for this function:

void mheap_put ( void *  v,
uword  uoffset 
)

Definition at line 761 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword mheap_put_small_object ( mheap_t h,
uword  bin,
uword  offset 
)
inlinestatic

Definition at line 344 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void mheap_put_trace ( void *  v,
uword  offset,
uword  size 
)
static

Definition at line 1573 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword mheap_small_object_cache_mask ( mheap_small_object_cache_t c,
uword  bin 
)
inlinestatic

Definition at line 302 of file mheap.c.

+ Here is the caller graph for this function:

void mheap_trace ( void *  v,
int  enable 
)

Definition at line 1626 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void mheap_trace_main_free ( mheap_trace_main_t tm)
inlinestatic

Definition at line 1617 of file mheap.c.

+ Here is the caller graph for this function:

static int mheap_trace_sort ( const void *  t1,
const void *  t2 
)
static

Definition at line 1604 of file mheap.c.

+ Here is the caller graph for this function:

void mheap_usage ( void *  v,
clib_mem_usage_t usage 
)

Definition at line 1078 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void mheap_usage_no_lock ( void *  v,
clib_mem_usage_t usage 
)
static

Definition at line 1042 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mheap_validate ( void *  v)

Definition at line 1344 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void mheap_validate_breakpoint ( )
static

Definition at line 1338 of file mheap.c.

+ Here is the call graph for this function:

static_always_inline uword mheap_vm ( void *  v,
uword  flags,
clib_address_t  start_addr,
uword  size 
)

Definition at line 258 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static_always_inline uword mheap_vm_elt ( void *  v,
uword  flags,
uword  offset 
)

Definition at line 290 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void new_free_elt ( void *  v,
uword  uoffset,
uword  n_user_data_bytes 
)
inlinestatic

Definition at line 196 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void remove_free_elt ( void *  v,
mheap_elt_t e,
uword  bin 
)
inlinestatic

Definition at line 203 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void remove_free_elt2 ( void *  v,
mheap_elt_t e 
)
inlinestatic

Definition at line 229 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void set_first_free_elt_offset ( mheap_t h,
uword  bin,
uword  uoffset 
)
inlinestatic

Definition at line 154 of file mheap.c.

+ Here is the caller graph for this function:

static void set_free_elt ( void *  v,
uword  uoffset,
uword  n_user_data_bytes 
)
inlinestatic

Definition at line 171 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword user_data_size_to_bin_index ( uword  n_user_data_bytes)
inlinestatic

Definition at line 92 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

uword mheap_page_size
static

Definition at line 243 of file mheap.c.