FD.io VPP  v19.04-6-g6f05f72
Vector Packet Processing
dlmalloc.c File Reference
+ Include dependency graph for dlmalloc.c:

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_chunkmchunkptr
 
typedef struct malloc_chunksbinptr
 
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_chunktchunkptr
 
typedef struct malloc_tree_chunktbinptr
 
typedef struct malloc_segment msegment
 
typedef struct malloc_segmentmsegmentptr
 
typedef struct malloc_statemstate
 

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
 

Macro Definition Documentation

#define ACQUIRE_MALLOC_GLOBAL_LOCK ( )

Definition at line 392 of file dlmalloc.c.

#define align_as_chunk (   A)    (mchunkptr)((A) + align_offset(chunk2mem(A)))

Definition at line 805 of file dlmalloc.c.

#define align_offset (   A)
Value:
((((size_t)(A) & CHUNK_ALIGN_MASK) == 0)? 0 :\
#define CHUNK_ALIGN_MASK
Definition: dlmalloc.c:193
#define A(x)
Definition: main.c:1024
#define MALLOC_ALIGNMENT
Definition: dlmalloc.h:633

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 (   S)    MFAIL

Define CALL_MORECORE.

Definition at line 297 of file dlmalloc.c.

#define CALL_MREMAP (   addr,
  osz,
  nsz,
  mv 
)    MFAIL

Define CALL_MREMAP.

Definition at line 342 of file dlmalloc.c.

#define CALL_MUNMAP (   a,
 
)    MUNMAP((a), (s))

Definition at line 329 of file dlmalloc.c.

#define calloc_must_clear (   p)    (1)

Definition at line 883 of file dlmalloc.c.

#define check_free_chunk (   M,
  P 
)

Definition at line 1382 of file dlmalloc.c.

#define check_inuse_chunk (   M,
  P 
)

Definition at line 1383 of file dlmalloc.c.

#define check_malloc_state (   M)

Definition at line 1386 of file dlmalloc.c.

#define check_malloced_chunk (   M,
  P,
 
)

Definition at line 1384 of file dlmalloc.c.

#define check_mmapped_chunk (   M,
  P 
)

Definition at line 1385 of file dlmalloc.c.

#define check_top_chunk (   M,
  P 
)

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,
 
)    ((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,
 
)    ((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.

#define clear_smallmap (   M,
  i 
)    ((M)->smallmap &= ~idx2bit(i))

Definition at line 1508 of file dlmalloc.c.

#define clear_treemap (   M,
  i 
)    ((M)->treemap &= ~idx2bit(i))

Definition at line 1512 of file dlmalloc.c.

#define CMFAIL   ((char*)(MFAIL)) /* defined for convenience */

Definition at line 214 of file dlmalloc.c.

#define compute_bit2idx (   X,
 
)
Value:
{\
unsigned int Y = X - 1;\
unsigned int K = Y >> (16-4) & 16;\
unsigned int N = K; Y >>= K;\
N += K = Y >> (8-3) & 8; Y >>= K;\
N += K = Y >> (4-2) & 4; Y >>= K;\
N += K = Y >> (2-1) & 2; Y >>= K;\
N += K = Y >> (1-0) & 1; Y >>= K;\
I = (bindex_t)(N + Y);\
}
unsigned int bindex_t
Definition: dlmalloc.c:778

Definition at line 1554 of file dlmalloc.c.

#define compute_tree_index (   S,
 
)
Value:
{\
size_t X = S >> TREEBIN_SHIFT;\
if (X == 0)\
I = 0;\
else if (X > 0xFFFF)\
I = NTREEBINS-1;\
else {\
unsigned int Y = (unsigned int)X;\
unsigned int N = ((Y - 0x100) >> 16) & 8;\
unsigned int K = (((Y <<= N) - 0x1000) >> 16) & 4;\
N += K;\
N += K = (((Y <<= K) - 0x4000) >> 16) & 2;\
K = 14 - N + ((Y <<= K) >> 15);\
I = (K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1));\
}\
}
#define S(mp)
#define NTREEBINS
Definition: dlmalloc.c:1155
#define TREEBIN_SHIFT
Definition: dlmalloc.c:1158

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,
 
)    (((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)
Value:
static struct malloc_params mparams
Definition: dlmalloc.c:1208
#define S(mp)
#define SIZE_T_ONE
Definition: dlmalloc.c:184
size_t granularity
Definition: dlmalloc.c:1202

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.

#define idx2bit (   i)    ((binmap_t)(1) << (i))

Definition at line 1504 of file dlmalloc.c.

#define INITIAL_LOCK (   l)    (0)

Definition at line 390 of file dlmalloc.c.

#define insert_chunk (   M,
  P,
  S 
)
Value:
else { tchunkptr TP = (tchunkptr)(P); insert_large_chunk(M, TP, S); }
#define S(mp)
#define insert_large_chunk(M, X, S)
Definition: dlmalloc.c:2242
#define P(fmt,...)
#define insert_small_chunk(M, P, S)
Definition: dlmalloc.c:2164
struct malloc_tree_chunk * tchunkptr
Definition: dlmalloc.c:990
#define is_small(s)
Definition: dlmalloc.c:1413
#define M(T, mp)

Definition at line 2383 of file dlmalloc.c.

#define insert_large_chunk (   M,
  X,
  S 
)
Value:
{\
H = treebin_at(M, I);\
X->index = I;\
X->child[0] = X->child[1] = 0;\
if (!treemap_is_marked(M, I)) {\
*H = X;\
X->parent = (tchunkptr)H;\
X->fd = X->bk = X;\
}\
else {\
tchunkptr T = *H;\
size_t K = S << leftshift_for_tree_index(I);\
for (;;) {\
if (chunksize(T) != S) {\
tchunkptr* C = &(T->child[(K >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]);\
K <<= 1;\
if (*C != 0)\
T = *C;\
else if (RTCHECK(ok_address(M, C))) {\
*C = X;\
X->parent = T;\
X->fd = X->bk = X;\
break;\
}\
else {\
break;\
}\
}\
else {\
tchunkptr F = T->fd;\
if (RTCHECK(ok_address(M, T) && ok_address(M, F))) {\
T->fd = F->bk = X;\
X->fd = F;\
X->bk = T;\
X->parent = 0;\
break;\
}\
else {\
break;\
}\
}\
}\
}\
}
#define RTCHECK(e)
Definition: dlmalloc.c:1629
#define treemap_is_marked(M, i)
Definition: dlmalloc.c:1513
#define S(mp)
struct malloc_tree_chunk * parent
Definition: dlmalloc.c:985
for(i=1;i<=collision_buckets;i++)
#define leftshift_for_tree_index(i)
Definition: dlmalloc.c:1491
struct malloc_tree_chunk * fd
Definition: dlmalloc.c:981
#define compute_tree_index(S, I)
Definition: dlmalloc.c:1467
struct malloc_tree_chunk * tbinptr
Definition: dlmalloc.c:991
struct malloc_tree_chunk * tchunkptr
Definition: dlmalloc.c:990
#define SIZE_T_BITSIZE
Definition: dlmalloc.c:179
unsigned int bindex_t
Definition: dlmalloc.c:778
#define mark_treemap(M, i)
Definition: dlmalloc.c:1511
#define SIZE_T_ONE
Definition: dlmalloc.c:184
struct malloc_tree_chunk * bk
Definition: dlmalloc.c:982
#define CORRUPTION_ERROR_ACTION(m)
Definition: dlmalloc.c:1368
#define ok_address(M, a)
Definition: dlmalloc.c:1598
#define treebin_at(M, i)
Definition: dlmalloc.c:1420
#define chunksize(p)
Definition: dlmalloc.c:846
#define M(T, mp)
#define F(n, v, s)
Definition: cuckoo_common.h:38

Definition at line 2242 of file dlmalloc.c.

#define insert_small_chunk (   M,
  P,
  S 
)
Value:
{\
else if (RTCHECK(ok_address(M, B->fd)))\
F = B->fd;\
else {\
}\
B->fd = P;\
F->bk = P;\
P->fd = F;\
P->bk = B;\
}
#define RTCHECK(e)
Definition: dlmalloc.c:1629
#define smallmap_is_marked(M, i)
Definition: dlmalloc.c:1509
#define S(mp)
#define assert(x)
Definition: dlmalloc.c:30
#define P(fmt,...)
struct malloc_chunk * mchunkptr
Definition: dlmalloc.c:776
#define small_index(s)
Definition: dlmalloc.c:1414
unsigned int bindex_t
Definition: dlmalloc.c:778
#define mark_smallmap(M, i)
Definition: dlmalloc.c:1507
#define CORRUPTION_ERROR_ACTION(m)
Definition: dlmalloc.c:1368
#define MIN_CHUNK_SIZE
Definition: dlmalloc.c:798
#define smallbin_at(M, i)
Definition: dlmalloc.c:1419
#define ok_address(M, a)
Definition: dlmalloc.c:1598
#define M(T, mp)
#define F(n, v, s)
Definition: cuckoo_common.h:38

Definition at line 2164 of file dlmalloc.c.

#define internal_free (   m,
  mem 
)    dlfree(mem)

Definition at line 2405 of file dlmalloc.c.

#define internal_malloc (   m,
 
)    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.

#define is_global (   M)    ((M) == &_gm_)

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.

#define is_initialized (   M)    ((M)->top != 0)

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)
Value:
((i == NTREEBINS-1)? 0 : \
((SIZE_T_BITSIZE-SIZE_T_ONE) - (((i) >> 1) + TREEBIN_SHIFT - 2)))
#define NTREEBINS
Definition: dlmalloc.c:1155
int i
#define SIZE_T_BITSIZE
Definition: dlmalloc.c:179
#define SIZE_T_ONE
Definition: dlmalloc.c:184
#define TREEBIN_SHIFT
Definition: dlmalloc.c:1158

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,
 
)

Definition at line 1639 of file dlmalloc.c.

#define mark_smallmap (   M,
  i 
)    ((M)->smallmap |= idx2bit(i))

Definition at line 1507 of file dlmalloc.c.

#define mark_treemap (   M,
  i 
)    ((M)->treemap |= idx2bit(i))

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)
Value:
((SIZE_T_ONE << (((i) >> 1) + TREEBIN_SHIFT)) | \
(((size_t)((i) & SIZE_T_ONE)) << (((i) >> 1) + TREEBIN_SHIFT - 1)))
int i
#define SIZE_T_ONE
Definition: dlmalloc.c:184
#define TREEBIN_SHIFT
Definition: dlmalloc.c:1158

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,
 
)    (-1)

Definition at line 325 of file dlmalloc.c.

#define next_chunk (   p)    ((mchunkptr)( ((char*)(p)) + ((p)->head & ~FLAG_BITS)))

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.

#define ok_address (   M,
  a 
)    ((char*)(a) >= (M)->least_addr)

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,
 
)    ((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 replace_dv (   M,
  P,
  S 
)
Value:
{\
size_t DVS = M->dvsize;\
if (DVS != 0) {\
mchunkptr DV = M->dv;\
}\
M->dvsize = S;\
M->dv = P;\
}
#define S(mp)
#define assert(x)
Definition: dlmalloc.c:30
#define P(fmt,...)
#define insert_small_chunk(M, P, S)
Definition: dlmalloc.c:2164
struct malloc_chunk * mchunkptr
Definition: dlmalloc.c:776
#define is_small(s)
Definition: dlmalloc.c:1413
#define M(T, mp)

Definition at line 2228 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.

#define segment_holds (   S,
  A 
)    ((char*)(A) >= S->base && (char*)(A) < S->base + S->size)

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,
 
)    (((mchunkptr)((char*)(p) + (s)))->prev_foot = (s))

Definition at line 865 of file dlmalloc.c.

#define set_free_with_pinuse (   p,
  s,
 
)    (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,
 
)
Value:
((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\
((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT)
#define PINUSE_BIT
Definition: dlmalloc.c:830
#define CINUSE_BIT
Definition: dlmalloc.c:831

Definition at line 1644 of file dlmalloc.c.

#define set_inuse_and_pinuse (   M,
  p,
 
)
Value:
((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\
((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT)
struct malloc_chunk * mchunkptr
Definition: dlmalloc.c:776
#define PINUSE_BIT
Definition: dlmalloc.c:830
#define CINUSE_BIT
Definition: dlmalloc.c:831

Definition at line 1649 of file dlmalloc.c.

#define set_lock (   M,
 
)
Value:
((M)->mflags = (L)?\
((M)->mflags | USE_LOCK_BIT) :\
((M)->mflags & ~USE_LOCK_BIT))
#define USE_LOCK_BIT
Definition: dlmalloc.c:389
#define M(T, mp)

Definition at line 1252 of file dlmalloc.c.

#define set_size_and_pinuse_of_free_chunk (   p,
 
)    ((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,
 
)    ((p)->head = (s|PINUSE_BIT|CINUSE_BIT))

Definition at line 1654 of file dlmalloc.c.

#define should_trim (   M,
 
)    ((s) > (M)->trim_check)

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.

#define smallbin_at (   M,
  i 
)    ((sbinptr)((char*)&((M)->smallbins[(i)<<1])))

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.

#define smallmap_is_marked (   M,
  i 
)    ((M)->smallmap & idx2bit(i))

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_at (   M,
  i 
)    (&((M)->treebins[i]))

Definition at line 1420 of file dlmalloc.c.

#define TREEBIN_SHIFT   (8U)

Definition at line 1158 of file dlmalloc.c.

#define treemap_is_marked (   M,
  i 
)    ((M)->treemap & idx2bit(i))

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.

#define unlink_chunk (   M,
  P,
  S 
)
Value:
else { tchunkptr TP = (tchunkptr)(P); unlink_large_chunk(M, TP); }
#define S(mp)
#define unlink_small_chunk(M, P, S)
Definition: dlmalloc.c:2183
#define unlink_large_chunk(M, X)
Definition: dlmalloc.c:2310
#define P(fmt,...)
struct malloc_tree_chunk * tchunkptr
Definition: dlmalloc.c:990
#define is_small(s)
Definition: dlmalloc.c:1413
#define M(T, mp)

Definition at line 2387 of file dlmalloc.c.

#define unlink_first_small_chunk (   M,
  B,
  P,
 
)
Value:
{\
mchunkptr F = P->fd;\
assert(P != B);\
assert(P != F);\
if (B == F) {\
}\
else if (RTCHECK(ok_address(M, F) && F->bk == P)) {\
F->bk = B;\
B->fd = F;\
}\
else {\
}\
}
#define RTCHECK(e)
Definition: dlmalloc.c:1629
#define assert(x)
Definition: dlmalloc.c:30
#define small_index2size(i)
Definition: dlmalloc.c:1415
#define clear_smallmap(M, i)
Definition: dlmalloc.c:1508
#define P(fmt,...)
struct malloc_chunk * mchunkptr
Definition: dlmalloc.c:776
#define CORRUPTION_ERROR_ACTION(m)
Definition: dlmalloc.c:1368
#define ok_address(M, a)
Definition: dlmalloc.c:1598
#define chunksize(p)
Definition: dlmalloc.c:846
#define M(T, mp)
#define F(n, v, s)
Definition: cuckoo_common.h:38

Definition at line 2209 of file dlmalloc.c.

#define unlink_large_chunk (   M,
 
)

Definition at line 2310 of file dlmalloc.c.

#define unlink_small_chunk (   M,
  P,
  S 
)
Value:
{\
mchunkptr F = P->fd;\
mchunkptr B = P->bk;\
assert(P != B);\
assert(P != F);\
if (RTCHECK(F == smallbin_at(M,I) || (ok_address(M, F) && F->bk == P))) { \
if (B == F) {\
}\
else if (RTCHECK(B == smallbin_at(M,I) ||\
(ok_address(M, B) && B->fd == P))) {\
F->bk = B;\
B->fd = F;\
}\
else {\
}\
}\
else {\
}\
}
#define RTCHECK(e)
Definition: dlmalloc.c:1629
#define S(mp)
#define assert(x)
Definition: dlmalloc.c:30
#define small_index2size(i)
Definition: dlmalloc.c:1415
#define clear_smallmap(M, i)
Definition: dlmalloc.c:1508
#define P(fmt,...)
struct malloc_chunk * mchunkptr
Definition: dlmalloc.c:776
#define small_index(s)
Definition: dlmalloc.c:1414
unsigned int bindex_t
Definition: dlmalloc.c:778
#define CORRUPTION_ERROR_ACTION(m)
Definition: dlmalloc.c:1368
#define smallbin_at(M, i)
Definition: dlmalloc.c:1419
#define ok_address(M, a)
Definition: dlmalloc.c:1598
#define chunksize(p)
Definition: dlmalloc.c:846
#define M(T, mp)
#define F(n, v, s)
Definition: cuckoo_common.h:38

Definition at line 2183 of file dlmalloc.c.

#define USAGE_ERROR_ACTION (   m,
 
)    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 Documentation

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.

Function Documentation

static void add_segment ( mstate  m,
char *  tbase,
size_t  tsize,
flag_t  mmapped 
)
static

Definition at line 2576 of file dlmalloc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int change_mparam ( int  param_number,
int  value 
)
static

Definition at line 1786 of file dlmalloc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void dispose_chunk ( mstate  m,
mchunkptr  p,
size_t  psize 
)
static

Definition at line 2960 of file dlmalloc.c.

+ Here is the caller graph for this function:

size_t dlbulk_free ( void *  array[],
size_t  nelem 
)

Definition at line 3913 of file dlmalloc.c.

+ Here is the call graph for this function:

void* dlcalloc ( size_t  n_elements,
size_t  elem_size 
)

Definition at line 3388 of file dlmalloc.c.

+ Here is the call graph for this function:

void dlfree ( void *  mem)

Definition at line 3279 of file dlmalloc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void** dlindependent_calloc ( size_t  n_elements,
size_t  elem_size,
void *  chunks[] 
)

Definition at line 3902 of file dlmalloc.c.

+ Here is the call graph for this function:

void** dlindependent_comalloc ( size_t  n_elements,
size_t  sizes[],
void *  chunks[] 
)

Definition at line 3908 of file dlmalloc.c.

+ Here is the call graph for this function:

struct dlmallinfo dlmallinfo ( void  )

Definition at line 3966 of file dlmalloc.c.

+ Here is the call graph for this function:

void* dlmalloc ( size_t  bytes)

Definition at line 3141 of file dlmalloc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 ( )

Definition at line 3972 of file dlmalloc.c.

+ Here is the call graph for this function:

int dlmalloc_trim ( size_t  pad)

Definition at line 3931 of file dlmalloc.c.

+ Here is the call graph for this function:

size_t dlmalloc_usable_size ( void *  mem)

Definition at line 3981 of file dlmalloc.c.

+ Here is the call graph for this function:

int dlmallopt ( int  param_number,
int  value 
)

Definition at line 3977 of file dlmalloc.c.

+ Here is the call graph for this function:

void* dlmemalign ( size_t  alignment,
size_t  bytes 
)

Definition at line 3858 of file dlmalloc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int dlposix_memalign ( void **  pp,
size_t  alignment,
size_t  bytes 
)

Definition at line 3865 of file dlmalloc.c.

+ Here is the call graph for this function:

void* dlpvalloc ( size_t  bytes)

Definition at line 3895 of file dlmalloc.c.

+ Here is the call graph for this function:

void* dlrealloc ( void *  oldmem,
size_t  bytes 
)

Definition at line 3782 of file dlmalloc.c.

+ Here is the call graph for this function:

void* dlrealloc_in_place ( void *  oldmem,
size_t  bytes 
)

Definition at line 3827 of file dlmalloc.c.

+ Here is the call graph for this function:

void* dlvalloc ( size_t  bytes)

Definition at line 3888 of file dlmalloc.c.

+ Here is the call graph for this function:

static int has_segment_link ( mstate  m,
msegmentptr  ss 
)
static

Definition at line 1298 of file dlmalloc.c.

+ Here is the caller graph for this function:

static void** ialloc ( mstate  m,
size_t  n_elements,
size_t *  sizes,
int  opts,
void *  chunks[] 
)
static

Definition at line 3568 of file dlmalloc.c.

+ Here is the caller graph for this function:

static void init_bins ( mstate  m)
static

Definition at line 2505 of file dlmalloc.c.

+ Here is the caller graph for this function:

static int init_mparams ( void  )
static

Definition at line 1692 of file dlmalloc.c.

static void init_top ( mstate  m,
mchunkptr  p,
size_t  psize 
)
static

Definition at line 2490 of file dlmalloc.c.

+ Here is the caller graph for this function:

static size_t internal_bulk_free ( mstate  m,
void *  array[],
size_t  nelem 
)
static

Definition at line 3694 of file dlmalloc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static struct dlmallinfo internal_mallinfo ( mstate  m)
static

Definition at line 2081 of file dlmalloc.c.

+ Here is the caller graph for this function:

static void internal_malloc_stats ( mstate  m)
static

Definition at line 2122 of file dlmalloc.c.

+ Here is the caller graph for this function:

static void* internal_memalign ( mstate  m,
size_t  alignment,
size_t  bytes 
)
static

Definition at line 3487 of file dlmalloc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void* mmap_alloc ( mstate  m,
size_t  nb 
)
static

Definition at line 2420 of file dlmalloc.c.

+ Here is the caller graph for this function:

static mchunkptr mmap_resize ( mstate  m,
mchunkptr  oldp,
size_t  nb,
int  flags 
)
static

Definition at line 2452 of file dlmalloc.c.

+ Here is the caller graph for this function:

static void* prepend_alloc ( mstate  m,
char *  newbase,
char *  oldbase,
size_t  nb 
)
static

Definition at line 2534 of file dlmalloc.c.

+ Here is the caller graph for this function:

static size_t release_unused_segments ( mstate  m)
static

Definition at line 2845 of file dlmalloc.c.

+ Here is the caller graph for this function:

static msegmentptr segment_holding ( mstate  m,
char *  addr 
)
static

Definition at line 1287 of file dlmalloc.c.

+ Here is the caller graph for this function:

static void* sys_alloc ( mstate  m,
size_t  nb 
)
static

Definition at line 2631 of file dlmalloc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int sys_trim ( mstate  m,
size_t  pad 
)
static

Definition at line 2892 of file dlmalloc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void* tmalloc_large ( mstate  m,
size_t  nb 
)
static

Definition at line 3031 of file dlmalloc.c.

+ Here is the caller graph for this function:

static void* tmalloc_small ( mstate  m,
size_t  nb 
)
static

Definition at line 3102 of file dlmalloc.c.

+ Here is the caller graph for this function:

static mchunkptr try_realloc_chunk ( mstate  m,
mchunkptr  p,
size_t  nb,
int  can_move 
)
static

Definition at line 3408 of file dlmalloc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

struct malloc_params mparams
static

Definition at line 1208 of file dlmalloc.c.