FD.io VPP
v19.08.3-2-gbabecb413
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 msegmentptr | segment_holding (mstate m, char *addr) |
static int | has_segment_link (mstate m, msegmentptr ss) |
static int | init_mparams (void) |
static int | change_mparam (int param_number, int value) |
static 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 void | init_top (mstate m, mchunkptr p, size_t psize) |
static void | init_bins (mstate m) |
static void * | prepend_alloc (mstate m, char *newbase, char *oldbase, size_t nb) |
static void | add_segment (mstate m, char *tbase, size_t tsize, flag_t mmapped) |
static void * | sys_alloc (mstate m, size_t nb) |
static size_t | release_unused_segments (mstate m) |
static int | sys_trim (mstate m, size_t pad) |
static void | dispose_chunk (mstate m, mchunkptr p, size_t psize) |
static void * | tmalloc_large (mstate m, size_t nb) |
static 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 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 392 of file dlmalloc.c.
Definition at line 805 of file dlmalloc.c.
#define align_offset | ( | A | ) |
Definition at line 199 of file dlmalloc.c.
#define assert | ( | x | ) |
Definition at line 30 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 1487 of file dlmalloc.c.
#define CALL_DIRECT_MMAP | ( | s | ) | DIRECT_MMAP(s) |
Definition at line 327 of file dlmalloc.c.
#define CALL_MMAP | ( | s | ) | MMAP(s) |
Definition at line 328 of file dlmalloc.c.
Define CALL_MORECORE.
Definition at line 297 of file dlmalloc.c.
Define CALL_MREMAP.
Definition at line 342 of file dlmalloc.c.
Definition at line 329 of file dlmalloc.c.
#define calloc_must_clear | ( | p | ) | (1) |
Definition at line 883 of file dlmalloc.c.
Definition at line 1382 of file dlmalloc.c.
Definition at line 1383 of file dlmalloc.c.
#define check_malloc_state | ( | M | ) |
Definition at line 1386 of file dlmalloc.c.
Definition at line 1384 of file dlmalloc.c.
Definition at line 1385 of file dlmalloc.c.
Definition at line 1387 of file dlmalloc.c.
#define chunk2mem | ( | p | ) | ((void*)((char*)(p) + TWO_SIZE_T_SIZES)) |
Definition at line 802 of file dlmalloc.c.
#define CHUNK_ALIGN_MASK (MALLOC_ALIGNMENT - SIZE_T_ONE) |
Definition at line 193 of file dlmalloc.c.
#define chunk_minus_offset | ( | p, | |
s | |||
) | ((mchunkptr)(((char*)(p)) - (s))) |
Definition at line 854 of file dlmalloc.c.
#define CHUNK_OVERHEAD (SIZE_T_SIZE) |
Definition at line 789 of file dlmalloc.c.
#define chunk_plus_offset | ( | p, | |
s | |||
) | ((mchunkptr)(((char*)(p)) + (s))) |
Definition at line 853 of file dlmalloc.c.
#define chunksize | ( | p | ) | ((p)->head & ~(FLAG_BITS)) |
Definition at line 846 of file dlmalloc.c.
#define cinuse | ( | p | ) | ((p)->head & CINUSE_BIT) |
Definition at line 840 of file dlmalloc.c.
#define CINUSE_BIT (SIZE_T_TWO) |
Definition at line 831 of file dlmalloc.c.
#define clear_flag4 | ( | p | ) | ((p)->head &= ~FLAG4_BIT) |
Definition at line 850 of file dlmalloc.c.
#define clear_pinuse | ( | p | ) | ((p)->head &= ~PINUSE_BIT) |
Definition at line 848 of file dlmalloc.c.
Definition at line 1508 of file dlmalloc.c.
Definition at line 1512 of file dlmalloc.c.
Definition at line 214 of file dlmalloc.c.
#define compute_bit2idx | ( | X, | |
I | |||
) |
Definition at line 1554 of file dlmalloc.c.
#define compute_tree_index | ( | S, | |
I | |||
) |
Definition at line 1467 of file dlmalloc.c.
#define CORRUPTION_ERROR_ACTION | ( | m | ) | DLM_ABORT |
Definition at line 1368 of file dlmalloc.c.
#define DEBUG 0 |
Definition at line 32 of file dlmalloc.c.
#define DESTROY_LOCK | ( | l | ) | (0) |
Definition at line 391 of file dlmalloc.c.
#define DIRECT_MMAP | ( | s | ) | MFAIL |
Definition at line 326 of file dlmalloc.c.
#define disable_contiguous | ( | M | ) | ((M)->mflags |= USE_NONCONTIGUOUS_BIT) |
Definition at line 1245 of file dlmalloc.c.
#define disable_expand | ( | M | ) | ((M)->mflags |= USE_NOEXPAND_BIT) |
Definition at line 1247 of file dlmalloc.c.
#define disable_lock | ( | M | ) |
Definition at line 1233 of file dlmalloc.c.
#define disable_mmap | ( | M | ) |
Definition at line 1241 of file dlmalloc.c.
#define disable_trace | ( | M | ) | ((M)->mflags &= ~USE_TRACE_BIT) |
Definition at line 1250 of file dlmalloc.c.
#define enable_lock | ( | M | ) | ((M)->mflags |= USE_LOCK_BIT) |
Definition at line 1229 of file dlmalloc.c.
#define enable_mmap | ( | M | ) | ((M)->mflags |= USE_MMAP_BIT) |
Definition at line 1237 of file dlmalloc.c.
#define enable_trace | ( | M | ) | ((M)->mflags |= USE_TRACE_BIT) |
Definition at line 1249 of file dlmalloc.c.
#define ensure_initialization | ( | ) | (void)(mparams.magic != 0 || init_mparams()) |
Definition at line 1211 of file dlmalloc.c.
#define EXTERN_BIT (8U) |
Definition at line 355 of file dlmalloc.c.
#define FENCEPOST_HEAD (INUSE_BITS|SIZE_T_SIZE) |
Definition at line 837 of file dlmalloc.c.
#define FLAG4_BIT (SIZE_T_FOUR) |
Definition at line 832 of file dlmalloc.c.
#define flag4inuse | ( | p | ) | ((p)->head & FLAG4_BIT) |
Definition at line 842 of file dlmalloc.c.
#define FLAG_BITS (PINUSE_BIT|CINUSE_BIT|FLAG4_BIT) |
Definition at line 834 of file dlmalloc.c.
#define fm gm |
#define FOUR_SIZE_T_SIZES (SIZE_T_SIZE<<2) |
Definition at line 188 of file dlmalloc.c.
#define get_foot | ( | p, | |
s | |||
) | (((mchunkptr)((char*)(p) + (s)))->prev_foot) |
Definition at line 864 of file dlmalloc.c.
#define gm (&_gm_) |
Definition at line 1217 of file dlmalloc.c.
#define granularity_align | ( | S | ) |
Definition at line 1262 of file dlmalloc.c.
#define HALF_MAX_SIZE_T (MAX_SIZE_T / 2U) |
Definition at line 190 of file dlmalloc.c.
Definition at line 1504 of file dlmalloc.c.
#define INITIAL_LOCK | ( | l | ) | (0) |
Definition at line 390 of file dlmalloc.c.
Definition at line 2383 of file dlmalloc.c.
Definition at line 2242 of file dlmalloc.c.
Definition at line 2164 of file dlmalloc.c.
Definition at line 2405 of file dlmalloc.c.
#define internal_malloc | ( | m, | |
b | |||
) | dlmalloc(b) |
Definition at line 2404 of file dlmalloc.c.
#define INUSE_BITS (PINUSE_BIT|CINUSE_BIT) |
Definition at line 833 of file dlmalloc.c.
#define is_aligned | ( | A | ) | (((size_t)((A)) & (CHUNK_ALIGN_MASK)) == 0) |
Definition at line 196 of file dlmalloc.c.
#define is_extern_segment | ( | S | ) | ((S)->sflags & EXTERN_BIT) |
Definition at line 1061 of file dlmalloc.c.
Definition at line 1218 of file dlmalloc.c.
#define is_granularity_aligned | ( | S | ) | (((size_t)(S) & (mparams.granularity - SIZE_T_ONE)) == 0) |
Definition at line 1279 of file dlmalloc.c.
Definition at line 1222 of file dlmalloc.c.
#define is_inuse | ( | p | ) | (((p)->head & INUSE_BITS) != PINUSE_BIT) |
Definition at line 843 of file dlmalloc.c.
#define is_mmapped | ( | p | ) | (((p)->head & INUSE_BITS) == 0) |
Definition at line 844 of file dlmalloc.c.
#define is_mmapped_segment | ( | S | ) | ((S)->sflags & USE_MMAP_BIT) |
Definition at line 1060 of file dlmalloc.c.
#define is_page_aligned | ( | S | ) | (((size_t)(S) & (mparams.page_size - SIZE_T_ONE)) == 0) |
Definition at line 1277 of file dlmalloc.c.
#define is_small | ( | s | ) | (((s) >> SMALLBIN_SHIFT) < NSMALLBINS) |
Definition at line 1413 of file dlmalloc.c.
#define least_bit | ( | x | ) | ((x) & -(x)) |
Definition at line 1516 of file dlmalloc.c.
#define left_bits | ( | x | ) | ((x<<1) | -(x<<1)) |
Definition at line 1519 of file dlmalloc.c.
#define leftmost_child | ( | t | ) | ((t)->child[0] != 0? (t)->child[0] : (t)->child[1]) |
Definition at line 994 of file dlmalloc.c.
#define leftshift_for_tree_index | ( | i | ) |
Definition at line 1491 of file dlmalloc.c.
#define LOCK_AT_FORK 0 |
Definition at line 106 of file dlmalloc.c.
#define malloc_getpagesize sysconf(_SC_PAGE_SIZE) |
Definition at line 136 of file dlmalloc.c.
#define mark_inuse_foot | ( | M, | |
p, | |||
s | |||
) |
Definition at line 1639 of file dlmalloc.c.
Definition at line 1507 of file dlmalloc.c.
Definition at line 1511 of file dlmalloc.c.
#define MAX_REQUEST ((-MIN_CHUNK_SIZE) << 2) |
Definition at line 808 of file dlmalloc.c.
#define MAX_SMALL_REQUEST (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD) |
Definition at line 1161 of file dlmalloc.c.
#define MAX_SMALL_SIZE (MIN_LARGE_SIZE - SIZE_T_ONE) |
Definition at line 1160 of file dlmalloc.c.
#define MCHUNK_SIZE (sizeof(mchunk)) |
Definition at line 784 of file dlmalloc.c.
#define mem2chunk | ( | mem | ) | ((mchunkptr)((char*)(mem) - TWO_SIZE_T_SIZES)) |
Definition at line 803 of file dlmalloc.c.
#define MFAIL ((void*)(MAX_SIZE_T)) |
Definition at line 213 of file dlmalloc.c.
#define MIN_CHUNK_SIZE ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) |
Definition at line 798 of file dlmalloc.c.
#define MIN_LARGE_SIZE (SIZE_T_ONE << TREEBIN_SHIFT) |
Definition at line 1159 of file dlmalloc.c.
#define MIN_REQUEST (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE) |
Definition at line 809 of file dlmalloc.c.
#define MIN_SMALL_INDEX (small_index(MIN_CHUNK_SIZE)) |
Definition at line 1416 of file dlmalloc.c.
#define minsize_for_tree_index | ( | i | ) |
Definition at line 1496 of file dlmalloc.c.
#define MMAP | ( | s | ) | MFAIL |
Definition at line 324 of file dlmalloc.c.
#define mmap_align | ( | S | ) | page_align(S) |
Definition at line 1271 of file dlmalloc.c.
#define MMAP_CHUNK_OVERHEAD (TWO_SIZE_T_SIZES) |
Definition at line 793 of file dlmalloc.c.
#define MMAP_FOOT_PAD (FOUR_SIZE_T_SIZES) |
Definition at line 795 of file dlmalloc.c.
#define MUNMAP | ( | a, | |
s | |||
) | (-1) |
Definition at line 325 of file dlmalloc.c.
Definition at line 857 of file dlmalloc.c.
#define next_pinuse | ( | p | ) | ((next_chunk(p)->head) & PINUSE_BIT) |
Definition at line 861 of file dlmalloc.c.
#define NSMALLBINS (32U) |
Definition at line 1154 of file dlmalloc.c.
#define NTREEBINS (32U) |
Definition at line 1155 of file dlmalloc.c.
Definition at line 1598 of file dlmalloc.c.
#define ok_inuse | ( | p | ) | is_inuse(p) |
Definition at line 1602 of file dlmalloc.c.
#define ok_magic | ( | M | ) | (1) |
Definition at line 1621 of file dlmalloc.c.
#define ok_next | ( | p, | |
n | |||
) | ((char*)(p) < (char*)(n)) |
Definition at line 1600 of file dlmalloc.c.
#define ok_pinuse | ( | p | ) | pinuse(p) |
Definition at line 1604 of file dlmalloc.c.
#define overhead_for | ( | p | ) | (is_mmapped(p)? MMAP_CHUNK_OVERHEAD : CHUNK_OVERHEAD) |
Definition at line 876 of file dlmalloc.c.
#define pad_request | ( | req | ) | (((req) + CHUNK_OVERHEAD + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) |
Definition at line 812 of file dlmalloc.c.
#define page_align | ( | S | ) | (((S) + (mparams.page_size - SIZE_T_ONE)) & ~(mparams.page_size - SIZE_T_ONE)) |
Definition at line 1258 of file dlmalloc.c.
#define pinuse | ( | p | ) | ((p)->head & PINUSE_BIT) |
Definition at line 841 of file dlmalloc.c.
#define PINUSE_BIT (SIZE_T_ONE) |
Definition at line 830 of file dlmalloc.c.
#define POSTACTION | ( | M | ) |
Definition at line 1341 of file dlmalloc.c.
#define PREACTION | ( | M | ) | (0) |
Definition at line 1337 of file dlmalloc.c.
#define prev_chunk | ( | p | ) | ((mchunkptr)( ((char*)(p)) - ((p)->prev_foot) )) |
Definition at line 858 of file dlmalloc.c.
#define RELEASE_MALLOC_GLOBAL_LOCK | ( | ) |
Definition at line 393 of file dlmalloc.c.
#define request2size | ( | req | ) | (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req)) |
Definition at line 816 of file dlmalloc.c.
#define RTCHECK | ( | e | ) | (e) |
Definition at line 1629 of file dlmalloc.c.
#define same_or_left_bits | ( | x | ) | ((x) | -(x)) |
Definition at line 1522 of file dlmalloc.c.
Definition at line 1283 of file dlmalloc.c.
#define set_flag4 | ( | p | ) | ((p)->head |= FLAG4_BIT) |
Definition at line 849 of file dlmalloc.c.
#define set_foot | ( | p, | |
s | |||
) | (((mchunkptr)((char*)(p) + (s)))->prev_foot = (s)) |
Definition at line 865 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 872 of file dlmalloc.c.
#define set_inuse | ( | M, | |
p, | |||
s | |||
) |
Definition at line 1644 of file dlmalloc.c.
#define set_inuse_and_pinuse | ( | M, | |
p, | |||
s | |||
) |
Definition at line 1649 of file dlmalloc.c.
#define set_lock | ( | M, | |
L | |||
) |
Definition at line 1252 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 868 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 1654 of file dlmalloc.c.
Definition at line 1309 of file dlmalloc.c.
#define SIX_SIZE_T_SIZES (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES) |
Definition at line 189 of file dlmalloc.c.
#define SIZE_T_BITSIZE (sizeof(size_t) << 3) |
Definition at line 179 of file dlmalloc.c.
#define SIZE_T_FOUR ((size_t)4) |
Definition at line 186 of file dlmalloc.c.
#define SIZE_T_ONE ((size_t)1) |
Definition at line 184 of file dlmalloc.c.
#define SIZE_T_SIZE (sizeof(size_t)) |
Definition at line 178 of file dlmalloc.c.
#define SIZE_T_TWO ((size_t)2) |
Definition at line 185 of file dlmalloc.c.
#define SIZE_T_ZERO ((size_t)0) |
Definition at line 183 of file dlmalloc.c.
#define small_index | ( | s | ) | (bindex_t)((s) >> SMALLBIN_SHIFT) |
Definition at line 1414 of file dlmalloc.c.
#define small_index2size | ( | i | ) | ((i) << SMALLBIN_SHIFT) |
Definition at line 1415 of file dlmalloc.c.
Definition at line 1419 of file dlmalloc.c.
#define SMALLBIN_SHIFT (3U) |
Definition at line 1156 of file dlmalloc.c.
#define SMALLBIN_WIDTH (SIZE_T_ONE << SMALLBIN_SHIFT) |
Definition at line 1157 of file dlmalloc.c.
Definition at line 1509 of file dlmalloc.c.
#define SYS_ALLOC_PADDING (TOP_FOOT_SIZE + MALLOC_ALIGNMENT) |
Definition at line 1275 of file dlmalloc.c.
#define TOP_FOOT_SIZE (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE) |
Definition at line 1319 of file dlmalloc.c.
#define TREEBIN_SHIFT (8U) |
Definition at line 1158 of file dlmalloc.c.
Definition at line 1513 of file dlmalloc.c.
#define TWO_SIZE_T_SIZES (SIZE_T_SIZE<<1) |
Definition at line 187 of file dlmalloc.c.
Definition at line 2387 of file dlmalloc.c.
#define unlink_large_chunk | ( | M, | |
X | |||
) |
Definition at line 2310 of file dlmalloc.c.
Definition at line 2183 of file dlmalloc.c.
#define USAGE_ERROR_ACTION | ( | m, | |
p | |||
) | DLM_ABORT |
Definition at line 1372 of file dlmalloc.c.
#define use_lock | ( | M | ) | ((M)->mflags & USE_LOCK_BIT) |
Definition at line 1228 of file dlmalloc.c.
#define USE_LOCK_BIT (0U) |
Definition at line 389 of file dlmalloc.c.
#define use_mmap | ( | M | ) | ((M)->mflags & USE_MMAP_BIT) |
Definition at line 1236 of file dlmalloc.c.
#define USE_MMAP_BIT (SIZE_T_ZERO) |
Define CALL_MMAP/CALL_MUNMAP/CALL_DIRECT_MMAP.
Definition at line 322 of file dlmalloc.c.
#define use_noexpand | ( | M | ) | ((M)->mflags & USE_NOEXPAND_BIT) |
Definition at line 1246 of file dlmalloc.c.
#define USE_NOEXPAND_BIT (8U) |
Definition at line 349 of file dlmalloc.c.
#define use_noncontiguous | ( | M | ) | ((M)->mflags & USE_NONCONTIGUOUS_BIT) |
Definition at line 1244 of file dlmalloc.c.
#define USE_NONCONTIGUOUS_BIT (4U) |
Definition at line 346 of file dlmalloc.c.
#define use_trace | ( | M | ) | ((M)->mflags & USE_TRACE_BIT) |
Definition at line 1248 of file dlmalloc.c.
#define USE_TRACE_BIT (16U) |
Definition at line 352 of file dlmalloc.c.
typedef unsigned int bindex_t |
Definition at line 778 of file dlmalloc.c.
typedef unsigned int binmap_t |
Definition at line 779 of file dlmalloc.c.
typedef unsigned int flag_t |
Definition at line 780 of file dlmalloc.c.
typedef struct malloc_chunk mchunk |
Definition at line 775 of file dlmalloc.c.
typedef struct malloc_chunk* mchunkptr |
Definition at line 776 of file dlmalloc.c.
typedef struct malloc_segment msegment |
Definition at line 1063 of file dlmalloc.c.
typedef struct malloc_segment* msegmentptr |
Definition at line 1064 of file dlmalloc.c.
typedef struct malloc_state* mstate |
Definition at line 1188 of file dlmalloc.c.
typedef struct malloc_chunk* sbinptr |
Definition at line 777 of file dlmalloc.c.
typedef struct malloc_tree_chunk* tbinptr |
Definition at line 991 of file dlmalloc.c.
typedef struct malloc_tree_chunk tchunk |
Definition at line 989 of file dlmalloc.c.
typedef struct malloc_tree_chunk* tchunkptr |
Definition at line 990 of file dlmalloc.c.
Definition at line 2576 of file dlmalloc.c.
|
static |
Definition at line 1786 of file dlmalloc.c.
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 3279 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 3141 of file dlmalloc.c.
size_t dlmalloc_footprint | ( | void | ) |
Definition at line 3941 of file dlmalloc.c.
size_t dlmalloc_footprint_limit | ( | void | ) |
Definition at line 3949 of file dlmalloc.c.
size_t dlmalloc_max_footprint | ( | void | ) |
Definition at line 3945 of file dlmalloc.c.
size_t dlmalloc_set_footprint_limit | ( | size_t | bytes | ) |
Definition at line 3954 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 3858 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 1692 of file dlmalloc.c.
|
static |
Definition at line 3694 of file dlmalloc.c.
|
static |
|
static |
|
static |
Definition at line 3487 of file dlmalloc.c.
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 2631 of file dlmalloc.c.
|
static |
Definition at line 2892 of file dlmalloc.c.
|
static |
|
static |
Definition at line 3408 of file dlmalloc.c.
|
static |
Definition at line 1208 of file dlmalloc.c.