FD.io VPP
v21.01.1
Vector Packet Processing
|
Go to the source code of this file.
Data Structures | |
struct | malloc_chunk |
struct | malloc_tree_chunk |
struct | malloc_segment |
struct | malloc_state |
struct | malloc_params |
Macros | |
#define | assert(x) |
#define | DEBUG 0 |
#define | LOCK_AT_FORK 0 |
#define | malloc_getpagesize sysconf(_SC_PAGE_SIZE) |
#define | SIZE_T_SIZE (sizeof(size_t)) |
#define | SIZE_T_BITSIZE (sizeof(size_t) << 3) |
#define | SIZE_T_ZERO ((size_t)0) |
#define | SIZE_T_ONE ((size_t)1) |
#define | SIZE_T_TWO ((size_t)2) |
#define | SIZE_T_FOUR ((size_t)4) |
#define | TWO_SIZE_T_SIZES (SIZE_T_SIZE<<1) |
#define | FOUR_SIZE_T_SIZES (SIZE_T_SIZE<<2) |
#define | SIX_SIZE_T_SIZES (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES) |
#define | HALF_MAX_SIZE_T (MAX_SIZE_T / 2U) |
#define | CHUNK_ALIGN_MASK (MALLOC_ALIGNMENT - SIZE_T_ONE) |
#define | is_aligned(A) (((size_t)((A)) & (CHUNK_ALIGN_MASK)) == 0) |
#define | align_offset(A) |
#define | MFAIL ((void*)(MAX_SIZE_T)) |
#define | CMFAIL ((char*)(MFAIL)) /* defined for convenience */ |
#define | CALL_MORECORE(S) MFAIL |
Define CALL_MORECORE. More... | |
#define | USE_MMAP_BIT (SIZE_T_ZERO) |
Define CALL_MMAP/CALL_MUNMAP/CALL_DIRECT_MMAP. More... | |
#define | MMAP(s) MFAIL |
#define | MUNMAP(a, s) (-1) |
#define | DIRECT_MMAP(s) MFAIL |
#define | CALL_DIRECT_MMAP(s) DIRECT_MMAP(s) |
#define | CALL_MMAP(s) MMAP(s) |
#define | CALL_MUNMAP(a, s) MUNMAP((a), (s)) |
#define | CALL_MREMAP(addr, osz, nsz, mv) MFAIL |
Define CALL_MREMAP. More... | |
#define | USE_NONCONTIGUOUS_BIT (4U) |
#define | USE_NOEXPAND_BIT (8U) |
#define | USE_TRACE_BIT (16U) |
#define | EXTERN_BIT (8U) |
#define | USE_LOCK_BIT (0U) |
#define | INITIAL_LOCK(l) (0) |
#define | DESTROY_LOCK(l) (0) |
#define | ACQUIRE_MALLOC_GLOBAL_LOCK() |
#define | RELEASE_MALLOC_GLOBAL_LOCK() |
#define | MCHUNK_SIZE (sizeof(mchunk)) |
#define | CHUNK_OVERHEAD (SIZE_T_SIZE) |
#define | MMAP_CHUNK_OVERHEAD (TWO_SIZE_T_SIZES) |
#define | MMAP_FOOT_PAD (FOUR_SIZE_T_SIZES) |
#define | MIN_CHUNK_SIZE ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) |
#define | chunk2mem(p) ((void*)((char*)(p) + TWO_SIZE_T_SIZES)) |
#define | mem2chunk(mem) ((mchunkptr)((char*)(mem) - TWO_SIZE_T_SIZES)) |
#define | align_as_chunk(A) (mchunkptr)((A) + align_offset(chunk2mem(A))) |
#define | MAX_REQUEST ((-MIN_CHUNK_SIZE) << 2) |
#define | MIN_REQUEST (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE) |
#define | pad_request(req) (((req) + CHUNK_OVERHEAD + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) |
#define | request2size(req) (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req)) |
#define | PINUSE_BIT (SIZE_T_ONE) |
#define | CINUSE_BIT (SIZE_T_TWO) |
#define | FLAG4_BIT (SIZE_T_FOUR) |
#define | INUSE_BITS (PINUSE_BIT|CINUSE_BIT) |
#define | FLAG_BITS (PINUSE_BIT|CINUSE_BIT|FLAG4_BIT) |
#define | FENCEPOST_HEAD (INUSE_BITS|SIZE_T_SIZE) |
#define | cinuse(p) ((p)->head & CINUSE_BIT) |
#define | pinuse(p) ((p)->head & PINUSE_BIT) |
#define | flag4inuse(p) ((p)->head & FLAG4_BIT) |
#define | is_inuse(p) (((p)->head & INUSE_BITS) != PINUSE_BIT) |
#define | is_mmapped(p) (((p)->head & INUSE_BITS) == 0) |
#define | chunksize(p) ((p)->head & ~(FLAG_BITS)) |
#define | clear_pinuse(p) ((p)->head &= ~PINUSE_BIT) |
#define | set_flag4(p) ((p)->head |= FLAG4_BIT) |
#define | clear_flag4(p) ((p)->head &= ~FLAG4_BIT) |
#define | chunk_plus_offset(p, s) ((mchunkptr)(((char*)(p)) + (s))) |
#define | chunk_minus_offset(p, s) ((mchunkptr)(((char*)(p)) - (s))) |
#define | next_chunk(p) ((mchunkptr)( ((char*)(p)) + ((p)->head & ~FLAG_BITS))) |
#define | prev_chunk(p) ((mchunkptr)( ((char*)(p)) - ((p)->prev_foot) )) |
#define | next_pinuse(p) ((next_chunk(p)->head) & PINUSE_BIT) |
#define | get_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_foot) |
#define | set_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_foot = (s)) |
#define | set_size_and_pinuse_of_free_chunk(p, s) ((p)->head = (s|PINUSE_BIT), set_foot(p, s)) |
#define | set_free_with_pinuse(p, s, n) (clear_pinuse(n), set_size_and_pinuse_of_free_chunk(p, s)) |
#define | overhead_for(p) (is_mmapped(p)? MMAP_CHUNK_OVERHEAD : CHUNK_OVERHEAD) |
#define | calloc_must_clear(p) (1) |
#define | leftmost_child(t) ((t)->child[0] != 0? (t)->child[0] : (t)->child[1]) |
#define | is_mmapped_segment(S) ((S)->sflags & USE_MMAP_BIT) |
#define | is_extern_segment(S) ((S)->sflags & EXTERN_BIT) |
#define | NSMALLBINS (32U) |
#define | NTREEBINS (32U) |
#define | SMALLBIN_SHIFT (3U) |
#define | SMALLBIN_WIDTH (SIZE_T_ONE << SMALLBIN_SHIFT) |
#define | TREEBIN_SHIFT (8U) |
#define | MIN_LARGE_SIZE (SIZE_T_ONE << TREEBIN_SHIFT) |
#define | MAX_SMALL_SIZE (MIN_LARGE_SIZE - SIZE_T_ONE) |
#define | MAX_SMALL_REQUEST (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD) |
#define | ensure_initialization() (void)(mparams.magic != 0 || init_mparams()) |
#define | gm (&_gm_) |
#define | is_global(M) ((M) == &_gm_) |
#define | is_initialized(M) ((M)->top != 0) |
#define | use_lock(M) ((M)->mflags & USE_LOCK_BIT) |
#define | enable_lock(M) ((M)->mflags |= USE_LOCK_BIT) |
#define | disable_lock(M) |
#define | use_mmap(M) ((M)->mflags & USE_MMAP_BIT) |
#define | enable_mmap(M) ((M)->mflags |= USE_MMAP_BIT) |
#define | disable_mmap(M) |
#define | use_noncontiguous(M) ((M)->mflags & USE_NONCONTIGUOUS_BIT) |
#define | disable_contiguous(M) ((M)->mflags |= USE_NONCONTIGUOUS_BIT) |
#define | use_noexpand(M) ((M)->mflags & USE_NOEXPAND_BIT) |
#define | disable_expand(M) ((M)->mflags |= USE_NOEXPAND_BIT) |
#define | use_trace(M) ((M)->mflags & USE_TRACE_BIT) |
#define | enable_trace(M) ((M)->mflags |= USE_TRACE_BIT) |
#define | disable_trace(M) ((M)->mflags &= ~USE_TRACE_BIT) |
#define | set_lock(M, L) |
#define | page_align(S) (((S) + (mparams.page_size - SIZE_T_ONE)) & ~(mparams.page_size - SIZE_T_ONE)) |
#define | granularity_align(S) |
#define | mmap_align(S) page_align(S) |
#define | SYS_ALLOC_PADDING (TOP_FOOT_SIZE + MALLOC_ALIGNMENT) |
#define | is_page_aligned(S) (((size_t)(S) & (mparams.page_size - SIZE_T_ONE)) == 0) |
#define | is_granularity_aligned(S) (((size_t)(S) & (mparams.granularity - SIZE_T_ONE)) == 0) |
#define | segment_holds(S, A) ((char*)(A) >= S->base && (char*)(A) < S->base + S->size) |
#define | should_trim(M, s) ((s) > (M)->trim_check) |
#define | TOP_FOOT_SIZE (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE) |
#define | PREACTION(M) (0) |
#define | POSTACTION(M) |
#define | CORRUPTION_ERROR_ACTION(m) DLM_ABORT |
#define | USAGE_ERROR_ACTION(m, p) DLM_ABORT |
#define | check_free_chunk(M, P) |
#define | check_inuse_chunk(M, P) |
#define | check_malloced_chunk(M, P, N) |
#define | check_mmapped_chunk(M, P) |
#define | check_malloc_state(M) |
#define | check_top_chunk(M, P) |
#define | is_small(s) (((s) >> SMALLBIN_SHIFT) < NSMALLBINS) |
#define | small_index(s) (bindex_t)((s) >> SMALLBIN_SHIFT) |
#define | small_index2size(i) ((i) << SMALLBIN_SHIFT) |
#define | MIN_SMALL_INDEX (small_index(MIN_CHUNK_SIZE)) |
#define | smallbin_at(M, i) ((sbinptr)((char*)&((M)->smallbins[(i)<<1]))) |
#define | treebin_at(M, i) (&((M)->treebins[i])) |
#define | compute_tree_index(S, I) |
#define | bit_for_tree_index(i) (i == NTREEBINS-1)? (SIZE_T_BITSIZE-1) : (((i) >> 1) + TREEBIN_SHIFT - 2) |
#define | leftshift_for_tree_index(i) |
#define | minsize_for_tree_index(i) |
#define | idx2bit(i) ((binmap_t)(1) << (i)) |
#define | mark_smallmap(M, i) ((M)->smallmap |= idx2bit(i)) |
#define | clear_smallmap(M, i) ((M)->smallmap &= ~idx2bit(i)) |
#define | smallmap_is_marked(M, i) ((M)->smallmap & idx2bit(i)) |
#define | mark_treemap(M, i) ((M)->treemap |= idx2bit(i)) |
#define | clear_treemap(M, i) ((M)->treemap &= ~idx2bit(i)) |
#define | treemap_is_marked(M, i) ((M)->treemap & idx2bit(i)) |
#define | least_bit(x) ((x) & -(x)) |
#define | left_bits(x) ((x<<1) | -(x<<1)) |
#define | same_or_left_bits(x) ((x) | -(x)) |
#define | compute_bit2idx(X, I) |
#define | ok_address(M, a) ((char*)(a) >= (M)->least_addr) |
#define | ok_next(p, n) ((char*)(p) < (char*)(n)) |
#define | ok_inuse(p) is_inuse(p) |
#define | ok_pinuse(p) pinuse(p) |
#define | ok_magic(M) (1) |
#define | RTCHECK(e) (e) |
#define | mark_inuse_foot(M, p, s) |
#define | set_inuse(M, p, s) |
#define | set_inuse_and_pinuse(M, p, s) |
#define | set_size_and_pinuse_of_inuse_chunk(M, p, s) ((p)->head = (s|PINUSE_BIT|CINUSE_BIT)) |
#define | insert_small_chunk(M, P, S) |
#define | unlink_small_chunk(M, P, S) |
#define | unlink_first_small_chunk(M, B, P, I) |
#define | replace_dv(M, P, S) |
#define | insert_large_chunk(M, X, S) |
#define | unlink_large_chunk(M, X) |
#define | insert_chunk(M, P, S) |
#define | unlink_chunk(M, P, S) |
#define | internal_malloc(m, b) dlmalloc(b) |
#define | internal_free(m, mem) dlfree(mem) |
#define | fm gm |
Typedefs | |
typedef struct malloc_chunk | mchunk |
typedef struct malloc_chunk * | mchunkptr |
typedef struct malloc_chunk * | sbinptr |
typedef unsigned int | bindex_t |
typedef unsigned int | binmap_t |
typedef unsigned int | flag_t |
typedef struct malloc_tree_chunk | tchunk |
typedef struct malloc_tree_chunk * | tchunkptr |
typedef struct malloc_tree_chunk * | tbinptr |
typedef struct malloc_segment | msegment |
typedef struct malloc_segment * | msegmentptr |
typedef struct malloc_state * | mstate |
Functions | |
static CLIB_NOSANITIZE_ADDR msegmentptr | segment_holding (mstate m, char *addr) |
static CLIB_NOSANITIZE_ADDR int | has_segment_link (mstate m, msegmentptr ss) |
static int | init_mparams (void) |
static int | change_mparam (int param_number, int value) |
static CLIB_NOSANITIZE_ADDR struct dlmallinfo | internal_mallinfo (mstate m) |
static void | internal_malloc_stats (mstate m) |
static void * | mmap_alloc (mstate m, size_t nb) |
static mchunkptr | mmap_resize (mstate m, mchunkptr oldp, size_t nb, int flags) |
static CLIB_NOSANITIZE_ADDR void | init_top (mstate m, mchunkptr p, size_t psize) |
static void | init_bins (mstate m) |
static CLIB_NOSANITIZE_ADDR void * | prepend_alloc (mstate m, char *newbase, char *oldbase, size_t nb) |
static CLIB_NOSANITIZE_ADDR void | add_segment (mstate m, char *tbase, size_t tsize, flag_t mmapped) |
static CLIB_NOSANITIZE_ADDR void * | sys_alloc (mstate m, size_t nb) |
static CLIB_NOSANITIZE_ADDR size_t | release_unused_segments (mstate m) |
static CLIB_NOSANITIZE_ADDR int | sys_trim (mstate m, size_t pad) |
static CLIB_NOSANITIZE_ADDR void | dispose_chunk (mstate m, mchunkptr p, size_t psize) |
static CLIB_NOSANITIZE_ADDR void * | tmalloc_large (mstate m, size_t nb) |
static CLIB_NOSANITIZE_ADDR void * | tmalloc_small (mstate m, size_t nb) |
void * | dlmalloc (size_t bytes) |
void | dlfree (void *mem) |
void * | dlcalloc (size_t n_elements, size_t elem_size) |
static mchunkptr | try_realloc_chunk (mstate m, mchunkptr p, size_t nb, int can_move) |
static CLIB_NOSANITIZE_ADDR void * | internal_memalign (mstate m, size_t alignment, size_t bytes) |
static void ** | ialloc (mstate m, size_t n_elements, size_t *sizes, int opts, void *chunks[]) |
static size_t | internal_bulk_free (mstate m, void *array[], size_t nelem) |
void * | dlrealloc (void *oldmem, size_t bytes) |
void * | dlrealloc_in_place (void *oldmem, size_t bytes) |
void * | dlmemalign (size_t alignment, size_t bytes) |
int | dlposix_memalign (void **pp, size_t alignment, size_t bytes) |
void * | dlvalloc (size_t bytes) |
void * | dlpvalloc (size_t bytes) |
void ** | dlindependent_calloc (size_t n_elements, size_t elem_size, void *chunks[]) |
void ** | dlindependent_comalloc (size_t n_elements, size_t sizes[], void *chunks[]) |
size_t | dlbulk_free (void *array[], size_t nelem) |
int | dlmalloc_trim (size_t pad) |
size_t | dlmalloc_footprint (void) |
size_t | dlmalloc_max_footprint (void) |
size_t | dlmalloc_footprint_limit (void) |
size_t | dlmalloc_set_footprint_limit (size_t bytes) |
struct dlmallinfo | dlmallinfo (void) |
void | dlmalloc_stats () |
int | dlmallopt (int param_number, int value) |
size_t | dlmalloc_usable_size (void *mem) |
Variables | |
static struct malloc_params | mparams |
#define ACQUIRE_MALLOC_GLOBAL_LOCK | ( | ) |
Definition at line 393 of file dlmalloc.c.
Definition at line 807 of file dlmalloc.c.
#define align_offset | ( | A | ) |
Definition at line 200 of file dlmalloc.c.
#define assert | ( | x | ) |
Definition at line 31 of file dlmalloc.c.
#define bit_for_tree_index | ( | i | ) | (i == NTREEBINS-1)? (SIZE_T_BITSIZE-1) : (((i) >> 1) + TREEBIN_SHIFT - 2) |
Definition at line 1491 of file dlmalloc.c.
#define CALL_DIRECT_MMAP | ( | s | ) | DIRECT_MMAP(s) |
Definition at line 328 of file dlmalloc.c.
#define CALL_MMAP | ( | s | ) | MMAP(s) |
Definition at line 329 of file dlmalloc.c.
Define CALL_MORECORE.
Definition at line 298 of file dlmalloc.c.
Define CALL_MREMAP.
Definition at line 343 of file dlmalloc.c.
Definition at line 330 of file dlmalloc.c.
#define calloc_must_clear | ( | p | ) | (1) |
Definition at line 885 of file dlmalloc.c.
Definition at line 1386 of file dlmalloc.c.
Definition at line 1387 of file dlmalloc.c.
#define check_malloc_state | ( | M | ) |
Definition at line 1390 of file dlmalloc.c.
Definition at line 1388 of file dlmalloc.c.
Definition at line 1389 of file dlmalloc.c.
Definition at line 1391 of file dlmalloc.c.
#define chunk2mem | ( | p | ) | ((void*)((char*)(p) + TWO_SIZE_T_SIZES)) |
Definition at line 804 of file dlmalloc.c.
#define CHUNK_ALIGN_MASK (MALLOC_ALIGNMENT - SIZE_T_ONE) |
Definition at line 194 of file dlmalloc.c.
#define chunk_minus_offset | ( | p, | |
s | |||
) | ((mchunkptr)(((char*)(p)) - (s))) |
Definition at line 856 of file dlmalloc.c.
#define CHUNK_OVERHEAD (SIZE_T_SIZE) |
Definition at line 791 of file dlmalloc.c.
#define chunk_plus_offset | ( | p, | |
s | |||
) | ((mchunkptr)(((char*)(p)) + (s))) |
Definition at line 855 of file dlmalloc.c.
#define chunksize | ( | p | ) | ((p)->head & ~(FLAG_BITS)) |
Definition at line 848 of file dlmalloc.c.
#define cinuse | ( | p | ) | ((p)->head & CINUSE_BIT) |
Definition at line 842 of file dlmalloc.c.
#define CINUSE_BIT (SIZE_T_TWO) |
Definition at line 833 of file dlmalloc.c.
#define clear_flag4 | ( | p | ) | ((p)->head &= ~FLAG4_BIT) |
Definition at line 852 of file dlmalloc.c.
#define clear_pinuse | ( | p | ) | ((p)->head &= ~PINUSE_BIT) |
Definition at line 850 of file dlmalloc.c.
Definition at line 1512 of file dlmalloc.c.
Definition at line 1516 of file dlmalloc.c.
Definition at line 215 of file dlmalloc.c.
#define compute_bit2idx | ( | X, | |
I | |||
) |
Definition at line 1558 of file dlmalloc.c.
#define compute_tree_index | ( | S, | |
I | |||
) |
Definition at line 1471 of file dlmalloc.c.
#define CORRUPTION_ERROR_ACTION | ( | m | ) | DLM_ABORT |
Definition at line 1372 of file dlmalloc.c.
#define DEBUG 0 |
Definition at line 33 of file dlmalloc.c.
#define DESTROY_LOCK | ( | l | ) | (0) |
Definition at line 392 of file dlmalloc.c.
#define DIRECT_MMAP | ( | s | ) | MFAIL |
Definition at line 327 of file dlmalloc.c.
#define disable_contiguous | ( | M | ) | ((M)->mflags |= USE_NONCONTIGUOUS_BIT) |
Definition at line 1247 of file dlmalloc.c.
#define disable_expand | ( | M | ) | ((M)->mflags |= USE_NOEXPAND_BIT) |
Definition at line 1249 of file dlmalloc.c.
#define disable_lock | ( | M | ) |
Definition at line 1235 of file dlmalloc.c.
#define disable_mmap | ( | M | ) |
Definition at line 1243 of file dlmalloc.c.
#define disable_trace | ( | M | ) | ((M)->mflags &= ~USE_TRACE_BIT) |
Definition at line 1252 of file dlmalloc.c.
#define enable_lock | ( | M | ) | ((M)->mflags |= USE_LOCK_BIT) |
Definition at line 1231 of file dlmalloc.c.
#define enable_mmap | ( | M | ) | ((M)->mflags |= USE_MMAP_BIT) |
Definition at line 1239 of file dlmalloc.c.
#define enable_trace | ( | M | ) | ((M)->mflags |= USE_TRACE_BIT) |
Definition at line 1251 of file dlmalloc.c.
#define ensure_initialization | ( | ) | (void)(mparams.magic != 0 || init_mparams()) |
Definition at line 1213 of file dlmalloc.c.
#define EXTERN_BIT (8U) |
Definition at line 356 of file dlmalloc.c.
#define FENCEPOST_HEAD (INUSE_BITS|SIZE_T_SIZE) |
Definition at line 839 of file dlmalloc.c.
#define FLAG4_BIT (SIZE_T_FOUR) |
Definition at line 834 of file dlmalloc.c.
#define flag4inuse | ( | p | ) | ((p)->head & FLAG4_BIT) |
Definition at line 844 of file dlmalloc.c.
#define FLAG_BITS (PINUSE_BIT|CINUSE_BIT|FLAG4_BIT) |
Definition at line 836 of file dlmalloc.c.
#define fm gm |
#define FOUR_SIZE_T_SIZES (SIZE_T_SIZE<<2) |
Definition at line 189 of file dlmalloc.c.
#define get_foot | ( | p, | |
s | |||
) | (((mchunkptr)((char*)(p) + (s)))->prev_foot) |
Definition at line 866 of file dlmalloc.c.
#define gm (&_gm_) |
Definition at line 1219 of file dlmalloc.c.
#define granularity_align | ( | S | ) |
Definition at line 1264 of file dlmalloc.c.
#define HALF_MAX_SIZE_T (MAX_SIZE_T / 2U) |
Definition at line 191 of file dlmalloc.c.
Definition at line 1508 of file dlmalloc.c.
#define INITIAL_LOCK | ( | l | ) | (0) |
Definition at line 391 of file dlmalloc.c.
Definition at line 2389 of file dlmalloc.c.
Definition at line 2248 of file dlmalloc.c.
Definition at line 2170 of file dlmalloc.c.
Definition at line 2411 of file dlmalloc.c.
Definition at line 2410 of file dlmalloc.c.
#define INUSE_BITS (PINUSE_BIT|CINUSE_BIT) |
Definition at line 835 of file dlmalloc.c.
#define is_aligned | ( | A | ) | (((size_t)((A)) & (CHUNK_ALIGN_MASK)) == 0) |
Definition at line 197 of file dlmalloc.c.
#define is_extern_segment | ( | S | ) | ((S)->sflags & EXTERN_BIT) |
Definition at line 1063 of file dlmalloc.c.
Definition at line 1220 of file dlmalloc.c.
#define is_granularity_aligned | ( | S | ) | (((size_t)(S) & (mparams.granularity - SIZE_T_ONE)) == 0) |
Definition at line 1281 of file dlmalloc.c.
Definition at line 1224 of file dlmalloc.c.
#define is_inuse | ( | p | ) | (((p)->head & INUSE_BITS) != PINUSE_BIT) |
Definition at line 845 of file dlmalloc.c.
#define is_mmapped | ( | p | ) | (((p)->head & INUSE_BITS) == 0) |
Definition at line 846 of file dlmalloc.c.
#define is_mmapped_segment | ( | S | ) | ((S)->sflags & USE_MMAP_BIT) |
Definition at line 1062 of file dlmalloc.c.
#define is_page_aligned | ( | S | ) | (((size_t)(S) & (mparams.page_size - SIZE_T_ONE)) == 0) |
Definition at line 1279 of file dlmalloc.c.
#define is_small | ( | s | ) | (((s) >> SMALLBIN_SHIFT) < NSMALLBINS) |
Definition at line 1417 of file dlmalloc.c.
#define least_bit | ( | x | ) | ((x) & -(x)) |
Definition at line 1520 of file dlmalloc.c.
#define left_bits | ( | x | ) | ((x<<1) | -(x<<1)) |
Definition at line 1523 of file dlmalloc.c.
#define leftmost_child | ( | t | ) | ((t)->child[0] != 0? (t)->child[0] : (t)->child[1]) |
Definition at line 996 of file dlmalloc.c.
#define leftshift_for_tree_index | ( | i | ) |
Definition at line 1495 of file dlmalloc.c.
#define LOCK_AT_FORK 0 |
Definition at line 107 of file dlmalloc.c.
#define malloc_getpagesize sysconf(_SC_PAGE_SIZE) |
Definition at line 137 of file dlmalloc.c.
#define mark_inuse_foot | ( | M, | |
p, | |||
s | |||
) |
Definition at line 1644 of file dlmalloc.c.
Definition at line 1511 of file dlmalloc.c.
Definition at line 1515 of file dlmalloc.c.
#define MAX_REQUEST ((-MIN_CHUNK_SIZE) << 2) |
Definition at line 810 of file dlmalloc.c.
#define MAX_SMALL_REQUEST (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD) |
Definition at line 1163 of file dlmalloc.c.
#define MAX_SMALL_SIZE (MIN_LARGE_SIZE - SIZE_T_ONE) |
Definition at line 1162 of file dlmalloc.c.
#define MCHUNK_SIZE (sizeof(mchunk)) |
Definition at line 786 of file dlmalloc.c.
#define mem2chunk | ( | mem | ) | ((mchunkptr)((char*)(mem) - TWO_SIZE_T_SIZES)) |
Definition at line 805 of file dlmalloc.c.
#define MFAIL ((void*)(MAX_SIZE_T)) |
Definition at line 214 of file dlmalloc.c.
#define MIN_CHUNK_SIZE ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) |
Definition at line 800 of file dlmalloc.c.
#define MIN_LARGE_SIZE (SIZE_T_ONE << TREEBIN_SHIFT) |
Definition at line 1161 of file dlmalloc.c.
#define MIN_REQUEST (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE) |
Definition at line 811 of file dlmalloc.c.
#define MIN_SMALL_INDEX (small_index(MIN_CHUNK_SIZE)) |
Definition at line 1420 of file dlmalloc.c.
#define minsize_for_tree_index | ( | i | ) |
Definition at line 1500 of file dlmalloc.c.
#define MMAP | ( | s | ) | MFAIL |
Definition at line 325 of file dlmalloc.c.
#define mmap_align | ( | S | ) | page_align(S) |
Definition at line 1273 of file dlmalloc.c.
#define MMAP_CHUNK_OVERHEAD (TWO_SIZE_T_SIZES) |
Definition at line 795 of file dlmalloc.c.
#define MMAP_FOOT_PAD (FOUR_SIZE_T_SIZES) |
Definition at line 797 of file dlmalloc.c.
#define MUNMAP | ( | a, | |
s | |||
) | (-1) |
Definition at line 326 of file dlmalloc.c.
Definition at line 859 of file dlmalloc.c.
#define next_pinuse | ( | p | ) | ((next_chunk(p)->head) & PINUSE_BIT) |
Definition at line 863 of file dlmalloc.c.
#define NSMALLBINS (32U) |
Definition at line 1156 of file dlmalloc.c.
#define NTREEBINS (32U) |
Definition at line 1157 of file dlmalloc.c.
Definition at line 1602 of file dlmalloc.c.
#define ok_inuse | ( | p | ) | is_inuse(p) |
Definition at line 1606 of file dlmalloc.c.
#define ok_magic | ( | M | ) | (1) |
Definition at line 1626 of file dlmalloc.c.
#define ok_next | ( | p, | |
n | |||
) | ((char*)(p) < (char*)(n)) |
Definition at line 1604 of file dlmalloc.c.
#define ok_pinuse | ( | p | ) | pinuse(p) |
Definition at line 1608 of file dlmalloc.c.
#define overhead_for | ( | p | ) | (is_mmapped(p)? MMAP_CHUNK_OVERHEAD : CHUNK_OVERHEAD) |
Definition at line 878 of file dlmalloc.c.
#define pad_request | ( | req | ) | (((req) + CHUNK_OVERHEAD + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) |
Definition at line 814 of file dlmalloc.c.
#define page_align | ( | S | ) | (((S) + (mparams.page_size - SIZE_T_ONE)) & ~(mparams.page_size - SIZE_T_ONE)) |
Definition at line 1260 of file dlmalloc.c.
#define pinuse | ( | p | ) | ((p)->head & PINUSE_BIT) |
Definition at line 843 of file dlmalloc.c.
#define PINUSE_BIT (SIZE_T_ONE) |
Definition at line 832 of file dlmalloc.c.
#define POSTACTION | ( | M | ) |
Definition at line 1345 of file dlmalloc.c.
#define PREACTION | ( | M | ) | (0) |
Definition at line 1341 of file dlmalloc.c.
#define prev_chunk | ( | p | ) | ((mchunkptr)( ((char*)(p)) - ((p)->prev_foot) )) |
Definition at line 860 of file dlmalloc.c.
#define RELEASE_MALLOC_GLOBAL_LOCK | ( | ) |
Definition at line 394 of file dlmalloc.c.
#define request2size | ( | req | ) | (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req)) |
Definition at line 818 of file dlmalloc.c.
#define RTCHECK | ( | e | ) | (e) |
Definition at line 1634 of file dlmalloc.c.
#define same_or_left_bits | ( | x | ) | ((x) | -(x)) |
Definition at line 1526 of file dlmalloc.c.
Definition at line 1285 of file dlmalloc.c.
#define set_flag4 | ( | p | ) | ((p)->head |= FLAG4_BIT) |
Definition at line 851 of file dlmalloc.c.
#define set_foot | ( | p, | |
s | |||
) | (((mchunkptr)((char*)(p) + (s)))->prev_foot = (s)) |
Definition at line 867 of file dlmalloc.c.
#define set_free_with_pinuse | ( | p, | |
s, | |||
n | |||
) | (clear_pinuse(n), set_size_and_pinuse_of_free_chunk(p, s)) |
Definition at line 874 of file dlmalloc.c.
#define set_inuse | ( | M, | |
p, | |||
s | |||
) |
Definition at line 1649 of file dlmalloc.c.
#define set_inuse_and_pinuse | ( | M, | |
p, | |||
s | |||
) |
Definition at line 1654 of file dlmalloc.c.
#define set_lock | ( | M, | |
L | |||
) |
Definition at line 1254 of file dlmalloc.c.
#define set_size_and_pinuse_of_free_chunk | ( | p, | |
s | |||
) | ((p)->head = (s|PINUSE_BIT), set_foot(p, s)) |
Definition at line 870 of file dlmalloc.c.
#define set_size_and_pinuse_of_inuse_chunk | ( | M, | |
p, | |||
s | |||
) | ((p)->head = (s|PINUSE_BIT|CINUSE_BIT)) |
Definition at line 1659 of file dlmalloc.c.
Definition at line 1313 of file dlmalloc.c.
#define SIX_SIZE_T_SIZES (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES) |
Definition at line 190 of file dlmalloc.c.
#define SIZE_T_BITSIZE (sizeof(size_t) << 3) |
Definition at line 180 of file dlmalloc.c.
#define SIZE_T_FOUR ((size_t)4) |
Definition at line 187 of file dlmalloc.c.
#define SIZE_T_ONE ((size_t)1) |
Definition at line 185 of file dlmalloc.c.
#define SIZE_T_SIZE (sizeof(size_t)) |
Definition at line 179 of file dlmalloc.c.
#define SIZE_T_TWO ((size_t)2) |
Definition at line 186 of file dlmalloc.c.
#define SIZE_T_ZERO ((size_t)0) |
Definition at line 184 of file dlmalloc.c.
#define small_index | ( | s | ) | (bindex_t)((s) >> SMALLBIN_SHIFT) |
Definition at line 1418 of file dlmalloc.c.
#define small_index2size | ( | i | ) | ((i) << SMALLBIN_SHIFT) |
Definition at line 1419 of file dlmalloc.c.
Definition at line 1423 of file dlmalloc.c.
#define SMALLBIN_SHIFT (3U) |
Definition at line 1158 of file dlmalloc.c.
#define SMALLBIN_WIDTH (SIZE_T_ONE << SMALLBIN_SHIFT) |
Definition at line 1159 of file dlmalloc.c.
Definition at line 1513 of file dlmalloc.c.
#define SYS_ALLOC_PADDING (TOP_FOOT_SIZE + MALLOC_ALIGNMENT) |
Definition at line 1277 of file dlmalloc.c.
#define TOP_FOOT_SIZE (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE) |
Definition at line 1323 of file dlmalloc.c.
#define TREEBIN_SHIFT (8U) |
Definition at line 1160 of file dlmalloc.c.
Definition at line 1517 of file dlmalloc.c.
#define TWO_SIZE_T_SIZES (SIZE_T_SIZE<<1) |
Definition at line 188 of file dlmalloc.c.
Definition at line 2393 of file dlmalloc.c.
#define unlink_large_chunk | ( | M, | |
X | |||
) |
Definition at line 2316 of file dlmalloc.c.
Definition at line 2189 of file dlmalloc.c.
#define USAGE_ERROR_ACTION | ( | m, | |
p | |||
) | DLM_ABORT |
Definition at line 1376 of file dlmalloc.c.
#define use_lock | ( | M | ) | ((M)->mflags & USE_LOCK_BIT) |
Definition at line 1230 of file dlmalloc.c.
#define USE_LOCK_BIT (0U) |
Definition at line 390 of file dlmalloc.c.
#define use_mmap | ( | M | ) | ((M)->mflags & USE_MMAP_BIT) |
Definition at line 1238 of file dlmalloc.c.
#define USE_MMAP_BIT (SIZE_T_ZERO) |
Define CALL_MMAP/CALL_MUNMAP/CALL_DIRECT_MMAP.
Definition at line 323 of file dlmalloc.c.
#define use_noexpand | ( | M | ) | ((M)->mflags & USE_NOEXPAND_BIT) |
Definition at line 1248 of file dlmalloc.c.
#define USE_NOEXPAND_BIT (8U) |
Definition at line 350 of file dlmalloc.c.
#define use_noncontiguous | ( | M | ) | ((M)->mflags & USE_NONCONTIGUOUS_BIT) |
Definition at line 1246 of file dlmalloc.c.
#define USE_NONCONTIGUOUS_BIT (4U) |
Definition at line 347 of file dlmalloc.c.
#define use_trace | ( | M | ) | ((M)->mflags & USE_TRACE_BIT) |
Definition at line 1250 of file dlmalloc.c.
#define USE_TRACE_BIT (16U) |
Definition at line 353 of file dlmalloc.c.
typedef unsigned int bindex_t |
Definition at line 780 of file dlmalloc.c.
typedef unsigned int binmap_t |
Definition at line 781 of file dlmalloc.c.
typedef unsigned int flag_t |
Definition at line 782 of file dlmalloc.c.
typedef struct malloc_chunk mchunk |
Definition at line 777 of file dlmalloc.c.
typedef struct malloc_chunk* mchunkptr |
Definition at line 778 of file dlmalloc.c.
typedef struct malloc_segment msegment |
Definition at line 1065 of file dlmalloc.c.
typedef struct malloc_segment* msegmentptr |
Definition at line 1066 of file dlmalloc.c.
typedef struct malloc_state* mstate |
Definition at line 1190 of file dlmalloc.c.
typedef struct malloc_chunk* sbinptr |
Definition at line 779 of file dlmalloc.c.
typedef struct malloc_tree_chunk* tbinptr |
Definition at line 993 of file dlmalloc.c.
typedef struct malloc_tree_chunk tchunk |
Definition at line 991 of file dlmalloc.c.
typedef struct malloc_tree_chunk* tchunkptr |
Definition at line 992 of file dlmalloc.c.
|
static |
Definition at line 2585 of file dlmalloc.c.
|
static |
Definition at line 1791 of file dlmalloc.c.
|
static |
size_t dlbulk_free | ( | void * | array[], |
size_t | nelem | ||
) |
void* dlcalloc | ( | size_t | n_elements, |
size_t | elem_size | ||
) |
void dlfree | ( | void * | mem | ) |
Definition at line 3294 of file dlmalloc.c.
void** dlindependent_calloc | ( | size_t | n_elements, |
size_t | elem_size, | ||
void * | chunks[] | ||
) |
void** dlindependent_comalloc | ( | size_t | n_elements, |
size_t | sizes[], | ||
void * | chunks[] | ||
) |
struct dlmallinfo dlmallinfo | ( | void | ) |
void* dlmalloc | ( | size_t | bytes | ) |
Definition at line 3156 of file dlmalloc.c.
size_t dlmalloc_footprint | ( | void | ) |
Definition at line 3957 of file dlmalloc.c.
size_t dlmalloc_footprint_limit | ( | void | ) |
Definition at line 3965 of file dlmalloc.c.
size_t dlmalloc_max_footprint | ( | void | ) |
Definition at line 3961 of file dlmalloc.c.
size_t dlmalloc_set_footprint_limit | ( | size_t | bytes | ) |
Definition at line 3970 of file dlmalloc.c.
void dlmalloc_stats | ( | ) |
int dlmalloc_trim | ( | size_t | pad | ) |
size_t dlmalloc_usable_size | ( | void * | mem | ) |
int dlmallopt | ( | int | param_number, |
int | value | ||
) |
void* dlmemalign | ( | size_t | alignment, |
size_t | bytes | ||
) |
Definition at line 3874 of file dlmalloc.c.
int dlposix_memalign | ( | void ** | pp, |
size_t | alignment, | ||
size_t | bytes | ||
) |
void* dlpvalloc | ( | size_t | bytes | ) |
void* dlrealloc | ( | void * | oldmem, |
size_t | bytes | ||
) |
void* dlrealloc_in_place | ( | void * | oldmem, |
size_t | bytes | ||
) |
void* dlvalloc | ( | size_t | bytes | ) |
|
static |
|
static |
|
static |
|
static |
Definition at line 1697 of file dlmalloc.c.
|
static |
|
static |
Definition at line 3710 of file dlmalloc.c.
|
static |
|
static |
|
static |
Definition at line 3503 of file dlmalloc.c.
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 2641 of file dlmalloc.c.
|
static |
Definition at line 2904 of file dlmalloc.c.
|
static |
|
static |
Definition at line 3423 of file dlmalloc.c.
|
static |
Definition at line 1210 of file dlmalloc.c.