FD.io VPP  v16.06
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)
 
always_inline void mheap_maybe_lock (void *v)
 
always_inline void mheap_maybe_unlock (void *v)
 
always_inline uword user_data_size_to_bin_index (uword n_user_data_bytes)
 
always_inline uword mheap_elt_size_to_user_n_bytes (uword n_bytes)
 
always_inline uword mheap_elt_size_to_user_n_words (uword n_bytes)
 
always_inline void mheap_elt_set_size (void *v, uword uoffset, uword n_user_data_bytes, uword is_free)
 
always_inline void set_first_free_elt_offset (mheap_t *h, uword bin, uword uoffset)
 
always_inline void set_free_elt (void *v, uword uoffset, uword n_user_data_bytes)
 
always_inline void new_free_elt (void *v, uword uoffset, uword n_user_data_bytes)
 
always_inline void remove_free_elt (void *v, mheap_elt_t *e, uword bin)
 
always_inline 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)
 
always_inline uword mheap_small_object_cache_mask (mheap_small_object_cache_t *c, uword bin)
 
always_inline uword mheap_get_small_object (mheap_t *h, uword bin)
 
always_inline 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 voidmheap_get_extend_vector (void *v, uword n_user_data_bytes, uword align, uword align_offset, uword *offset_return)
 
voidmheap_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)
 
voidmheap_alloc_with_flags (void *memory, uword memory_size, uword flags)
 
voidmheap_alloc (void *memory, uword size)
 
void mheap_foreach (void *v, uword(*func)(void *arg, void *v, void *elt_data, uword elt_size), void *arg)
 
always_inline 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)
 
always_inline 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 222 of file mheap.c.

#define MHEAP_VM_NOMAP   (0 << 1)

Definition at line 224 of file mheap.c.

#define MHEAP_VM_ROUND   (1 << 2)

Definition at line 225 of file mheap.c.

#define MHEAP_VM_ROUND_DOWN   (0 << 2)

Definition at line 227 of file mheap.c.

#define MHEAP_VM_ROUND_UP   MHEAP_VM_ROUND

Definition at line 226 of file mheap.c.

#define MHEAP_VM_UNMAP   (1 << 1)

Definition at line 223 of file mheap.c.

Function Documentation

void dmh ( void v)

Definition at line 1275 of file mheap.c.

+ Here is the call graph for this function:

u8* format_mheap ( u8 s,
va_list *  va 
)

Definition at line 1113 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 1033 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 1070 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 701 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 908 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 842 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 988 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline uword mheap_bytes_overhead ( void v)

Definition at line 981 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void mheap_elt_set_size ( void v,
uword  uoffset,
uword  n_user_data_bytes,
uword  is_free 
)

Definition at line 126 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline uword mheap_elt_size_to_user_n_bytes ( uword  n_bytes)

Definition at line 112 of file mheap.c.

+ Here is the caller graph for this function:

always_inline uword mheap_elt_size_to_user_n_words ( uword  n_bytes)

Definition at line 119 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 1043 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 933 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 621 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 547 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 358 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 501 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline uword mheap_get_small_object ( mheap_t h,
uword  bin 
)

Definition at line 308 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 1427 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void mheap_maybe_lock ( void v)

Definition at line 53 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void mheap_maybe_unlock ( void v)

Definition at line 73 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 231 of file mheap.c.

+ Here is the caller graph for this function:

static_always_inline uword mheap_page_truncate ( uword  addr)

Definition at line 234 of file mheap.c.

+ Here is the caller graph for this function:

void mheap_put ( void v,
uword  uoffset 
)

Definition at line 728 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline uword mheap_put_small_object ( mheap_t h,
uword  bin,
uword  offset 
)

Definition at line 327 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 1498 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline uword mheap_small_object_cache_mask ( mheap_small_object_cache_t c,
uword  bin 
)

Definition at line 285 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mheap_trace ( void v,
int  enable 
)

Definition at line 1549 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void mheap_trace_main_free ( mheap_trace_main_t tm)

Definition at line 1541 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 1528 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 1026 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 991 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 1281 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 1278 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 238 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 273 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void new_free_elt ( void v,
uword  uoffset,
uword  n_user_data_bytes 
)

Definition at line 187 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void remove_free_elt ( void v,
mheap_elt_t e,
uword  bin 
)

Definition at line 194 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void remove_free_elt2 ( void v,
mheap_elt_t e 
)

Definition at line 215 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void set_first_free_elt_offset ( mheap_t h,
uword  bin,
uword  uoffset 
)

Definition at line 145 of file mheap.c.

+ Here is the caller graph for this function:

always_inline void set_free_elt ( void v,
uword  uoffset,
uword  n_user_data_bytes 
)

Definition at line 162 of file mheap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline uword user_data_size_to_bin_index ( uword  n_user_data_bytes)

Definition at line 90 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 229 of file mheap.c.