Geant4_10
Classes | Macros | Typedefs | Functions
mymalloc.cc File Reference
#include <sys/types.h>
#include <iostream>
#include "tls.hh"
#include <stdio.h>
#include <errno.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/param.h>
Include dependency graph for mymalloc.cc:

Go to the source code of this file.

Classes

struct  mallinfo
 
struct  malloc_chunk
 
struct  malloc_tree_chunk
 
struct  malloc_segment
 
struct  malloc_state
 
struct  malloc_params
 

Macros

#define MSPACES   1
 
#define DLMALLOC_VERSION   20804
 
#define SPIN_LOCKS_AVAILABLE   0
 
#define MAX_SIZE_T   (~(size_t)0)
 
#define ONLY_MSPACES   0 /* define to a value */
 
#define MALLOC_ALIGNMENT   ((size_t)8U)
 
#define FOOTERS   0
 
#define ABORT   abort()
 
#define ABORT_ON_ASSERT_FAILURE   1
 
#define PROCEED_ON_ERROR   0
 
#define USE_LOCKS   0
 
#define USE_SPIN_LOCKS   0
 
#define INSECURE   0
 
#define HAVE_MMAP   1
 
#define MMAP_CLEARS   1
 
#define HAVE_MREMAP   0
 
#define MALLOC_FAILURE_ACTION   errno = ENOMEM;
 
#define HAVE_MORECORE   1
 
#define MORECORE_DEFAULT   sbrk
 
#define MORECORE_CONTIGUOUS   1
 
#define DEFAULT_GRANULARITY   (0) /* 0 means to compute in init_mparams */
 
#define DEFAULT_TRIM_THRESHOLD   ((size_t)2U * (size_t)1024U * (size_t)1024U)
 
#define DEFAULT_MMAP_THRESHOLD   ((size_t)256U * (size_t)1024U)
 
#define MAX_RELEASE_CHECK_RATE   4095
 
#define USE_BUILTIN_FFS   0
 
#define USE_DEV_RANDOM   0
 
#define NO_MALLINFO   0
 
#define MALLINFO_FIELD_TYPE   size_t
 
#define NO_SEGMENT_TRAVERSAL   0
 
#define M_TRIM_THRESHOLD   (-1)
 
#define M_GRANULARITY   (-2)
 
#define M_MMAP_THRESHOLD   (-3)
 
#define STRUCT_MALLINFO_DECLARED   1
 
#define NOINLINE
 
#define FORCEINLINE
 
#define dlcalloc   mycalloc
 
#define dlfree   myfree
 
#define dlmalloc   mymalloc
 
#define dlmemalign   mymemalign
 
#define dlrealloc   myrealloc
 
#define dlvalloc   myvalloc
 
#define dlpvalloc   mypvalloc
 
#define dlmallinfo   mymallinfo
 
#define dlmallopt   mymallopt
 
#define dlmalloc_trim   mymalloc_trim
 
#define dlmalloc_stats   mymalloc_stats
 
#define dlmalloc_usable_size   mymalloc_usable_size
 
#define dlmalloc_footprint   mymalloc_footprint
 
#define dlmalloc_max_footprint   mymalloc_max_footprint
 
#define dlindependent_calloc   myindependent_calloc
 
#define dlindependent_comalloc   myindependent_comalloc
 
#define assert(x)
 
#define DEBUG   0
 
#define malloc_getpagesize   ((size_t)4096U)
 
#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 MUNMAP_DEFAULT(a, s)   munmap((a), (s))
 
#define MMAP_PROT   (PROT_READ|PROT_WRITE)
 
#define MMAP_FLAGS   (MAP_PRIVATE)
 
#define MMAP_DEFAULT(s)
 
#define DIRECT_MMAP_DEFAULT(s)   MMAP_DEFAULT(s)
 
#define CALL_MORECORE(S)   MORECORE_DEFAULT(S)
 
#define USE_MMAP_BIT   (SIZE_T_ONE)
 
#define CALL_MMAP(s)   MMAP_DEFAULT(s)
 
#define CALL_MUNMAP(a, s)   MUNMAP_DEFAULT((a), (s))
 
#define CALL_DIRECT_MMAP(s)   DIRECT_MMAP_DEFAULT(s)
 
#define CALL_MREMAP(addr, osz, nsz, mv)   MFAIL
 
#define USE_NONCONTIGUOUS_BIT   (4U)
 
#define EXTERN_BIT   (8U)
 
#define USE_LOCK_BIT   (0U)
 
#define INITIAL_LOCK(l)
 
#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 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 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)   (!is_mmapped(p))
 
#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)   ((M)->mflags &= ~USE_LOCK_BIT)
 
#define use_mmap(M)   ((M)->mflags & USE_MMAP_BIT)
 
#define enable_mmap(M)   ((M)->mflags |= USE_MMAP_BIT)
 
#define disable_mmap(M)   ((M)->mflags &= ~USE_MMAP_BIT)
 
#define use_noncontiguous(M)   ((M)->mflags & USE_NONCONTIGUOUS_BIT)
 
#define disable_contiguous(M)   ((M)->mflags |= USE_NONCONTIGUOUS_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)   ABORT
 
#define USAGE_ERROR_ACTION(m, p)   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)   ((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)   (m == gm)? dlmalloc(b) : mspace_malloc(m, b)
 
#define internal_free(m, mem)   if (m == gm) dlfree(mem); else mspace_free(m,mem);
 
#define fm   gm
 

Typedefs

typedef voidmspace
 
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

voiddlmalloc (size_t)
 
void dlfree (void *)
 
voiddlcalloc (size_t, size_t)
 
voiddlrealloc (void *, size_t)
 
voiddlmemalign (size_t, size_t)
 
voiddlvalloc (size_t)
 
int dlmallopt (int, int)
 
size_t dlmalloc_footprint (void)
 
size_t dlmalloc_max_footprint (void)
 
struct mallinfo dlmallinfo (void)
 
void ** dlindependent_calloc (size_t, size_t, void **)
 
void ** dlindependent_comalloc (size_t, size_t *, void **)
 
voiddlpvalloc (size_t)
 
int dlmalloc_trim (size_t)
 
void dlmalloc_stats (void)
 
size_t dlmalloc_usable_size (void *)
 
mspace create_mspace (size_t capacity, int locked)
 
size_t destroy_mspace (mspace msp)
 
mspace create_mspace_with_base (void *base, size_t capacity, int locked)
 
int mspace_track_large_chunks (mspace msp, int enable)
 
voidmspace_malloc (mspace msp, size_t bytes)
 
void mspace_free (mspace msp, void *mem)
 
voidmspace_realloc (mspace msp, void *mem, size_t newsize)
 
voidmspace_calloc (mspace msp, size_t n_elements, size_t elem_size)
 
voidmspace_memalign (mspace msp, size_t alignment, size_t bytes)
 
void ** mspace_independent_calloc (mspace msp, size_t n_elements, size_t elem_size, void *chunks[])
 
void ** mspace_independent_comalloc (mspace msp, size_t n_elements, size_t sizes[], void *chunks[])
 
size_t mspace_footprint (mspace msp)
 
size_t mspace_max_footprint (mspace msp)
 
struct mallinfo mspace_mallinfo (mspace msp)
 
size_t mspace_usable_size (void *mem)
 
void mspace_malloc_stats (mspace msp)
 
int mspace_trim (mspace msp, size_t pad)
 
int mspace_mallopt (int, int)
 
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[])
 

Macro Definition Documentation

#define ABORT   abort()

Definition at line 566 of file mymalloc.cc.

#define ABORT_ON_ASSERT_FAILURE   1

Definition at line 569 of file mymalloc.cc.

#define ACQUIRE_MALLOC_GLOBAL_LOCK ( )

Definition at line 1915 of file mymalloc.cc.

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

Definition at line 2094 of file mymalloc.cc.

#define align_offset (   A)
Value:
((((size_t)(A) & CHUNK_ALIGN_MASK) == 0)? 0 :\
#define CHUNK_ALIGN_MASK
Definition: mymalloc.cc:1456
#define MALLOC_ALIGNMENT
Definition: mymalloc.cc:560

Definition at line 1462 of file mymalloc.cc.

#define assert (   x)

Definition at line 1309 of file mymalloc.cc.

#define bit_for_tree_index (   i)    (i == NTREEBINS-1)? (SIZE_T_BITSIZE-1) : (((i) >> 1) + TREEBIN_SHIFT - 2)

Definition at line 2757 of file mymalloc.cc.

#define CALL_DIRECT_MMAP (   s)    DIRECT_MMAP_DEFAULT(s)

Definition at line 1583 of file mymalloc.cc.

#define CALL_MMAP (   s)    MMAP_DEFAULT(s)

Definition at line 1573 of file mymalloc.cc.

#define CALL_MORECORE (   S)    MORECORE_DEFAULT(S)

Define CALL_MORECORE

Definition at line 1558 of file mymalloc.cc.

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

Define CALL_MREMAP

Definition at line 1606 of file mymalloc.cc.

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

Definition at line 1578 of file mymalloc.cc.

#define calloc_must_clear (   p)    (!is_mmapped(p))

Definition at line 2167 of file mymalloc.cc.

#define check_free_chunk (   M,
 
)

Definition at line 2651 of file mymalloc.cc.

#define check_inuse_chunk (   M,
 
)

Definition at line 2652 of file mymalloc.cc.

#define check_malloc_state (   M)

Definition at line 2655 of file mymalloc.cc.

#define check_malloced_chunk (   M,
  P,
  N 
)

Definition at line 2653 of file mymalloc.cc.

#define check_mmapped_chunk (   M,
 
)

Definition at line 2654 of file mymalloc.cc.

#define check_top_chunk (   M,
 
)

Definition at line 2656 of file mymalloc.cc.

#define chunk2mem (   p)    ((void*)((char*)(p) + TWO_SIZE_T_SIZES))

Definition at line 2091 of file mymalloc.cc.

#define CHUNK_ALIGN_MASK   (MALLOC_ALIGNMENT - SIZE_T_ONE)

Definition at line 1456 of file mymalloc.cc.

#define chunk_minus_offset (   p,
  s 
)    ((mchunkptr)(((char*)(p)) - (s)))

Definition at line 2140 of file mymalloc.cc.

#define CHUNK_OVERHEAD   (SIZE_T_SIZE)

Definition at line 2078 of file mymalloc.cc.

#define chunk_plus_offset (   p,
  s 
)    ((mchunkptr)(((char*)(p)) + (s)))

Definition at line 2139 of file mymalloc.cc.

#define chunksize (   p)    ((p)->head & ~(FLAG_BITS))

Definition at line 2134 of file mymalloc.cc.

#define cinuse (   p)    ((p)->head & CINUSE_BIT)

Definition at line 2129 of file mymalloc.cc.

#define CINUSE_BIT   (SIZE_T_TWO)

Definition at line 2120 of file mymalloc.cc.

#define clear_pinuse (   p)    ((p)->head &= ~PINUSE_BIT)

Definition at line 2136 of file mymalloc.cc.

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

Definition at line 2778 of file mymalloc.cc.

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

Definition at line 2782 of file mymalloc.cc.

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

Definition at line 1477 of file mymalloc.cc.

#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);\
}
Float_t Y
Definition: plot.C:39
unsigned int bindex_t
Definition: mymalloc.cc:2067
Float_t X
Definition: plot.C:39
**D E S C R I P T I O N
Definition: HEPEvtcom.cc:77

Definition at line 2824 of file mymalloc.cc.

#define compute_tree_index (   S,
 
)
Value:
{\
size_t X = S >> TREEBIN_SHIFT;\
if (X == 0)\
I = 0;\
else if (X > 0xFFFF)\
I = NTREEBINS-1;\
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));\
}\
}
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
Float_t Y
Definition: plot.C:39
Float_t X
Definition: plot.C:39
#define TREEBIN_SHIFT
Definition: mymalloc.cc:2441
if(nlines<=0)
#define NTREEBINS
Definition: mymalloc.cc:2438
**D E S C R I P T I O N
Definition: HEPEvtcom.cc:77

Definition at line 2737 of file mymalloc.cc.

#define CORRUPTION_ERROR_ACTION (   m)    ABORT

Definition at line 2638 of file mymalloc.cc.

#define DEBUG   0

Definition at line 1311 of file mymalloc.cc.

#define DEFAULT_GRANULARITY   (0) /* 0 means to compute in init_mparams */

Definition at line 620 of file mymalloc.cc.

#define DEFAULT_MMAP_THRESHOLD   ((size_t)256U * (size_t)1024U)

Definition at line 634 of file mymalloc.cc.

#define DEFAULT_TRIM_THRESHOLD   ((size_t)2U * (size_t)1024U * (size_t)1024U)

Definition at line 627 of file mymalloc.cc.

#define DIRECT_MMAP_DEFAULT (   s)    MMAP_DEFAULT(s)

Definition at line 1503 of file mymalloc.cc.

#define disable_contiguous (   M)    ((M)->mflags |= USE_NONCONTIGUOUS_BIT)

Definition at line 2519 of file mymalloc.cc.

#define disable_lock (   M)    ((M)->mflags &= ~USE_LOCK_BIT)

Definition at line 2512 of file mymalloc.cc.

#define disable_mmap (   M)    ((M)->mflags &= ~USE_MMAP_BIT)

Definition at line 2516 of file mymalloc.cc.

#define dlcalloc   mycalloc

Definition at line 760 of file mymalloc.cc.

#define dlfree   myfree

Definition at line 761 of file mymalloc.cc.

#define dlindependent_calloc   myindependent_calloc

Definition at line 774 of file mymalloc.cc.

#define dlindependent_comalloc   myindependent_comalloc

Definition at line 775 of file mymalloc.cc.

#define dlmallinfo   mymallinfo

Definition at line 767 of file mymalloc.cc.

#define dlmalloc   mymalloc

Definition at line 762 of file mymalloc.cc.

#define dlmalloc_footprint   mymalloc_footprint

Definition at line 772 of file mymalloc.cc.

#define dlmalloc_max_footprint   mymalloc_max_footprint

Definition at line 773 of file mymalloc.cc.

#define dlmalloc_stats   mymalloc_stats

Definition at line 770 of file mymalloc.cc.

#define dlmalloc_trim   mymalloc_trim

Definition at line 769 of file mymalloc.cc.

#define dlmalloc_usable_size   mymalloc_usable_size

Definition at line 771 of file mymalloc.cc.

#define DLMALLOC_VERSION   20804

Definition at line 488 of file mymalloc.cc.

#define dlmallopt   mymallopt

Definition at line 768 of file mymalloc.cc.

#define dlmemalign   mymemalign

Definition at line 763 of file mymalloc.cc.

#define dlpvalloc   mypvalloc

Definition at line 766 of file mymalloc.cc.

#define dlrealloc   myrealloc

Definition at line 764 of file mymalloc.cc.

#define dlvalloc   myvalloc

Definition at line 765 of file mymalloc.cc.

#define enable_lock (   M)    ((M)->mflags |= USE_LOCK_BIT)

Definition at line 2511 of file mymalloc.cc.

#define enable_mmap (   M)    ((M)->mflags |= USE_MMAP_BIT)

Definition at line 2515 of file mymalloc.cc.

#define ensure_initialization ( )    (void)(mparams.magic != 0 || init_mparams())

Definition at line 2493 of file mymalloc.cc.

#define EXTERN_BIT   (8U)

Definition at line 1613 of file mymalloc.cc.

#define FENCEPOST_HEAD   (INUSE_BITS|SIZE_T_SIZE)

Definition at line 2126 of file mymalloc.cc.

#define FLAG4_BIT   (SIZE_T_FOUR)

Definition at line 2121 of file mymalloc.cc.

#define FLAG_BITS   (PINUSE_BIT|CINUSE_BIT|FLAG4_BIT)

Definition at line 2123 of file mymalloc.cc.

#define fm   gm
#define FOOTERS   0

Definition at line 563 of file mymalloc.cc.

#define FORCEINLINE

Definition at line 752 of file mymalloc.cc.

#define FOUR_SIZE_T_SIZES   (SIZE_T_SIZE<<2)

Definition at line 1451 of file mymalloc.cc.

#define get_foot (   p,
  s 
)    (((mchunkptr)((char*)(p) + (s)))->prev_foot)

Definition at line 2150 of file mymalloc.cc.

#define gm   (&_gm_)

Definition at line 2499 of file mymalloc.cc.

#define granularity_align (   S)
Value:
(((S) + (mparams.granularity - SIZE_T_ONE))\
& ~(mparams.granularity - SIZE_T_ONE))
#define SIZE_T_ONE
Definition: mymalloc.cc:1447
size_t granularity
Definition: mymalloc.cc:2484

Definition at line 2531 of file mymalloc.cc.

#define HALF_MAX_SIZE_T   (MAX_SIZE_T / 2U)

Definition at line 1453 of file mymalloc.cc.

#define HAVE_MMAP   1

Definition at line 588 of file mymalloc.cc.

#define HAVE_MORECORE   1

Definition at line 607 of file mymalloc.cc.

#define HAVE_MREMAP   0

Definition at line 597 of file mymalloc.cc.

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

Definition at line 2774 of file mymalloc.cc.

#define INITIAL_LOCK (   l)

Definition at line 1904 of file mymalloc.cc.

#define INSECURE   0

Definition at line 585 of file mymalloc.cc.

#define insert_chunk (   M,
  P,
 
)
Value:
if (is_small(S)) insert_small_chunk(M, P, S)\
else { tchunkptr TP = (tchunkptr)(P); insert_large_chunk(M, TP, S); }
struct malloc_tree_chunk * tchunkptr
Definition: mymalloc.cc:2276
#define insert_small_chunk(M, P, S)
Definition: mymalloc.cc:3415
#define is_small(s)
Definition: mymalloc.cc:2682
#define insert_large_chunk(M, X, S)
Definition: mymalloc.cc:3488

Definition at line 3629 of file mymalloc.cc.

#define insert_large_chunk (   M,
  X,
 
)

Definition at line 3488 of file mymalloc.cc.

#define insert_small_chunk (   M,
  P,
 
)
Value:
{\
else if (RTCHECK(ok_address(M, B->fd)))\
F = B->fd;\
}\
B->fd = P;\
F->bk = P;\
P->fd = F;\
P->bk = B;\
}
#define CORRUPTION_ERROR_ACTION(m)
Definition: mymalloc.cc:2638
struct malloc_chunk * mchunkptr
Definition: mymalloc.cc:2065
#define assert(x)
Definition: mymalloc.cc:1309
#define mark_smallmap(M, i)
Definition: mymalloc.cc:2777
#define smallbin_at(M, i)
Definition: mymalloc.cc:2688
unsigned int bindex_t
Definition: mymalloc.cc:2067
if(nlines<=0)
#define smallmap_is_marked(M, i)
Definition: mymalloc.cc:2779
#define small_index(s)
Definition: mymalloc.cc:2683
#define ok_address(M, a)
Definition: mymalloc.cc:2868
#define MIN_CHUNK_SIZE
Definition: mymalloc.cc:2087
#define RTCHECK(e)
Definition: mymalloc.cc:2896

Definition at line 3415 of file mymalloc.cc.

#define internal_free (   m,
  mem 
)    if (m == gm) dlfree(mem); else mspace_free(m,mem);

Definition at line 3647 of file mymalloc.cc.

#define internal_malloc (   m,
 
)    (m == gm)? dlmalloc(b) : mspace_malloc(m, b)

Definition at line 3645 of file mymalloc.cc.

#define INUSE_BITS   (PINUSE_BIT|CINUSE_BIT)

Definition at line 2122 of file mymalloc.cc.

#define is_aligned (   A)    (((size_t)((A)) & (CHUNK_ALIGN_MASK)) == 0)

Definition at line 1459 of file mymalloc.cc.

#define is_extern_segment (   S)    ((S)->sflags & EXTERN_BIT)

Definition at line 2347 of file mymalloc.cc.

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

Definition at line 2500 of file mymalloc.cc.

#define is_granularity_aligned (   S)    (((size_t)(S) & (mparams.granularity - SIZE_T_ONE)) == 0)

Definition at line 2548 of file mymalloc.cc.

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

Definition at line 2504 of file mymalloc.cc.

#define is_inuse (   p)    (((p)->head & INUSE_BITS) != PINUSE_BIT)

Definition at line 2131 of file mymalloc.cc.

#define is_mmapped (   p)    (((p)->head & INUSE_BITS) == 0)

Definition at line 2132 of file mymalloc.cc.

#define is_mmapped_segment (   S)    ((S)->sflags & USE_MMAP_BIT)

Definition at line 2346 of file mymalloc.cc.

#define is_page_aligned (   S)    (((size_t)(S) & (mparams.page_size - SIZE_T_ONE)) == 0)

Definition at line 2546 of file mymalloc.cc.

#define is_small (   s)    (((s) >> SMALLBIN_SHIFT) < NSMALLBINS)

Definition at line 2682 of file mymalloc.cc.

#define least_bit (   x)    ((x) & -(x))

Definition at line 2786 of file mymalloc.cc.

#define left_bits (   x)    ((x<<1) | -(x<<1))

Definition at line 2789 of file mymalloc.cc.

#define leftmost_child (   t)    ((t)->child[0] != 0? (t)->child[0] : (t)->child[1])

Definition at line 2280 of file mymalloc.cc.

#define leftshift_for_tree_index (   i)
Value:
((i == NTREEBINS-1)? 0 : \
((SIZE_T_BITSIZE-SIZE_T_ONE) - (((i) >> 1) + TREEBIN_SHIFT - 2)))
#define SIZE_T_ONE
Definition: mymalloc.cc:1447
#define TREEBIN_SHIFT
Definition: mymalloc.cc:2441
#define NTREEBINS
Definition: mymalloc.cc:2438
#define SIZE_T_BITSIZE
Definition: mymalloc.cc:1442

Definition at line 2761 of file mymalloc.cc.

#define M_GRANULARITY   (-2)

Definition at line 670 of file mymalloc.cc.

#define M_MMAP_THRESHOLD   (-3)

Definition at line 671 of file mymalloc.cc.

#define M_TRIM_THRESHOLD   (-1)

Definition at line 669 of file mymalloc.cc.

#define MALLINFO_FIELD_TYPE   size_t

Definition at line 656 of file mymalloc.cc.

#define MALLOC_ALIGNMENT   ((size_t)8U)

Definition at line 560 of file mymalloc.cc.

#define MALLOC_FAILURE_ACTION   errno = ENOMEM;

Definition at line 601 of file mymalloc.cc.

#define malloc_getpagesize   ((size_t)4096U)

Definition at line 1425 of file mymalloc.cc.

#define mark_inuse_foot (   M,
  p,
  s 
)

Definition at line 2906 of file mymalloc.cc.

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

Definition at line 2777 of file mymalloc.cc.

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

Definition at line 2781 of file mymalloc.cc.

#define MAX_RELEASE_CHECK_RATE   4095

Definition at line 641 of file mymalloc.cc.

#define MAX_REQUEST   ((-MIN_CHUNK_SIZE) << 2)

Definition at line 2097 of file mymalloc.cc.

#define MAX_SIZE_T   (~(size_t)0)

Definition at line 545 of file mymalloc.cc.

#define MAX_SMALL_REQUEST   (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD)

Definition at line 2444 of file mymalloc.cc.

#define MAX_SMALL_SIZE   (MIN_LARGE_SIZE - SIZE_T_ONE)

Definition at line 2443 of file mymalloc.cc.

#define MCHUNK_SIZE   (sizeof(mchunk))

Definition at line 2073 of file mymalloc.cc.

#define mem2chunk (   mem)    ((mchunkptr)((char*)(mem) - TWO_SIZE_T_SIZES))

Definition at line 2092 of file mymalloc.cc.

#define MFAIL   ((void*)(MAX_SIZE_T))

Definition at line 1476 of file mymalloc.cc.

#define MIN_CHUNK_SIZE   ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK)

Definition at line 2087 of file mymalloc.cc.

#define MIN_LARGE_SIZE   (SIZE_T_ONE << TREEBIN_SHIFT)

Definition at line 2442 of file mymalloc.cc.

#define MIN_REQUEST   (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE)

Definition at line 2098 of file mymalloc.cc.

#define MIN_SMALL_INDEX   (small_index(MIN_CHUNK_SIZE))

Definition at line 2685 of file mymalloc.cc.

#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)))
#define SIZE_T_ONE
Definition: mymalloc.cc:1447
#define TREEBIN_SHIFT
Definition: mymalloc.cc:2441

Definition at line 2766 of file mymalloc.cc.

#define mmap_align (   S)    page_align(S)

Definition at line 2540 of file mymalloc.cc.

#define MMAP_CHUNK_OVERHEAD   (TWO_SIZE_T_SIZES)

Definition at line 2082 of file mymalloc.cc.

#define MMAP_CLEARS   1

Definition at line 591 of file mymalloc.cc.

#define MMAP_DEFAULT (   s)
Value:
((dev_zero_fd < 0) ? \
(dev_zero_fd = open("/dev/zero", O_RDWR), \
mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0)) : \
mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0))
const XML_Char * s
Definition: expat.h:262
#define MMAP_FLAGS
Definition: mymalloc.cc:1495
in open(doseFileSim)
#define MMAP_PROT
Definition: mymalloc.cc:1483

Definition at line 1497 of file mymalloc.cc.

#define MMAP_FLAGS   (MAP_PRIVATE)

Definition at line 1495 of file mymalloc.cc.

#define MMAP_FOOT_PAD   (FOUR_SIZE_T_SIZES)

Definition at line 2084 of file mymalloc.cc.

#define MMAP_PROT   (PROT_READ|PROT_WRITE)

Definition at line 1483 of file mymalloc.cc.

#define MORECORE_CONTIGUOUS   1

Definition at line 615 of file mymalloc.cc.

#define MORECORE_DEFAULT   sbrk

Definition at line 613 of file mymalloc.cc.

#define MSPACES   1

Definition at line 485 of file mymalloc.cc.

#define MUNMAP_DEFAULT (   a,
  s 
)    munmap((a), (s))

Definition at line 1482 of file mymalloc.cc.

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

Definition at line 2143 of file mymalloc.cc.

#define next_pinuse (   p)    ((next_chunk(p)->head) & PINUSE_BIT)

Definition at line 2147 of file mymalloc.cc.

#define NO_MALLINFO   0

Definition at line 653 of file mymalloc.cc.

#define NO_SEGMENT_TRAVERSAL   0

Definition at line 659 of file mymalloc.cc.

#define NOINLINE

Definition at line 741 of file mymalloc.cc.

#define NSMALLBINS   (32U)

Definition at line 2437 of file mymalloc.cc.

#define NTREEBINS   (32U)

Definition at line 2438 of file mymalloc.cc.

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

Definition at line 2868 of file mymalloc.cc.

#define ok_inuse (   p)    is_inuse(p)

Definition at line 2872 of file mymalloc.cc.

#define ok_magic (   M)    (1)

Definition at line 2887 of file mymalloc.cc.

#define ok_next (   p,
  n 
)    ((char*)(p) < (char*)(n))

Definition at line 2870 of file mymalloc.cc.

#define ok_pinuse (   p)    pinuse(p)

Definition at line 2874 of file mymalloc.cc.

#define ONLY_MSPACES   0 /* define to a value */

Definition at line 548 of file mymalloc.cc.

#define overhead_for (   p)    (is_mmapped(p)? MMAP_CHUNK_OVERHEAD : CHUNK_OVERHEAD)

Definition at line 2162 of file mymalloc.cc.

#define pad_request (   req)    (((req) + CHUNK_OVERHEAD + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK)

Definition at line 2101 of file mymalloc.cc.

#define page_align (   S)    (((S) + (mparams.page_size - SIZE_T_ONE)) & ~(mparams.page_size - SIZE_T_ONE))

Definition at line 2527 of file mymalloc.cc.

#define pinuse (   p)    ((p)->head & PINUSE_BIT)

Definition at line 2130 of file mymalloc.cc.

#define PINUSE_BIT   (SIZE_T_ONE)

Definition at line 2119 of file mymalloc.cc.

#define POSTACTION (   M)

Definition at line 2611 of file mymalloc.cc.

#define PREACTION (   M)    (0)

Definition at line 2607 of file mymalloc.cc.

#define prev_chunk (   p)    ((mchunkptr)( ((char*)(p)) - ((p)->prev_foot) ))

Definition at line 2144 of file mymalloc.cc.

#define PROCEED_ON_ERROR   0

Definition at line 572 of file mymalloc.cc.

#define RELEASE_MALLOC_GLOBAL_LOCK ( )

Definition at line 1916 of file mymalloc.cc.

#define replace_dv (   M,
  P,
 
)
Value:
{\
size_t DVS = M->dvsize;\
if (DVS != 0) {\
mchunkptr DV = M->dv;\
insert_small_chunk(M, DV, DVS);\
}\
M->dvsize = S;\
M->dv = P;\
}
struct malloc_chunk * mchunkptr
Definition: mymalloc.cc:2065
#define insert_small_chunk(M, P, S)
Definition: mymalloc.cc:3415
#define is_small(s)
Definition: mymalloc.cc:2682
#define assert(x)
Definition: mymalloc.cc:1309
if(nlines<=0)

Definition at line 3474 of file mymalloc.cc.

#define request2size (   req)    (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req))

Definition at line 2105 of file mymalloc.cc.

#define RTCHECK (   e)    (e)

Definition at line 2896 of file mymalloc.cc.

#define same_or_left_bits (   x)    ((x) | -(x))

Definition at line 2792 of file mymalloc.cc.

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

Definition at line 2552 of file mymalloc.cc.

#define set_foot (   p,
  s 
)    (((mchunkptr)((char*)(p) + (s)))->prev_foot = (s))

Definition at line 2151 of file mymalloc.cc.

#define set_free_with_pinuse (   p,
  s,
  n 
)    (clear_pinuse(n), set_size_and_pinuse_of_free_chunk(p, s))

Definition at line 2158 of file mymalloc.cc.

#define set_inuse (   M,
  p,
  s 
)
Value:
((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\
((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT)
#define CINUSE_BIT
Definition: mymalloc.cc:2120
const XML_Char * s
Definition: expat.h:262
#define PINUSE_BIT
Definition: mymalloc.cc:2119
const char * p
Definition: xmltok.h:285

Definition at line 2911 of file mymalloc.cc.

#define set_inuse_and_pinuse (   M,
  p,
  s 
)
Value:
((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\
((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT)
#define CINUSE_BIT
Definition: mymalloc.cc:2120
struct malloc_chunk * mchunkptr
Definition: mymalloc.cc:2065
const XML_Char * s
Definition: expat.h:262
#define PINUSE_BIT
Definition: mymalloc.cc:2119
const char * p
Definition: xmltok.h:285

Definition at line 2916 of file mymalloc.cc.

#define set_lock (   M,
 
)
Value:
((M)->mflags = (L)?\
((M)->mflags | USE_LOCK_BIT) :\
((M)->mflags & ~USE_LOCK_BIT))
#define USE_LOCK_BIT
Definition: mymalloc.cc:1903

Definition at line 2521 of file mymalloc.cc.

#define set_size_and_pinuse_of_free_chunk (   p,
  s 
)    ((p)->head = (s|PINUSE_BIT), set_foot(p, s))

Definition at line 2154 of file mymalloc.cc.

#define set_size_and_pinuse_of_inuse_chunk (   M,
  p,
  s 
)    ((p)->head = (s|PINUSE_BIT|CINUSE_BIT))

Definition at line 2921 of file mymalloc.cc.

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

Definition at line 2578 of file mymalloc.cc.

#define SIX_SIZE_T_SIZES   (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES)

Definition at line 1452 of file mymalloc.cc.

#define SIZE_T_BITSIZE   (sizeof(size_t) << 3)

Definition at line 1442 of file mymalloc.cc.

#define SIZE_T_FOUR   ((size_t)4)

Definition at line 1449 of file mymalloc.cc.

#define SIZE_T_ONE   ((size_t)1)

Definition at line 1447 of file mymalloc.cc.

#define SIZE_T_SIZE   (sizeof(size_t))

Definition at line 1441 of file mymalloc.cc.

#define SIZE_T_TWO   ((size_t)2)

Definition at line 1448 of file mymalloc.cc.

#define SIZE_T_ZERO   ((size_t)0)

Definition at line 1446 of file mymalloc.cc.

#define small_index (   s)    ((s) >> SMALLBIN_SHIFT)

Definition at line 2683 of file mymalloc.cc.

#define small_index2size (   i)    ((i) << SMALLBIN_SHIFT)

Definition at line 2684 of file mymalloc.cc.

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

Definition at line 2688 of file mymalloc.cc.

#define SMALLBIN_SHIFT   (3U)

Definition at line 2439 of file mymalloc.cc.

#define SMALLBIN_WIDTH   (SIZE_T_ONE << SMALLBIN_SHIFT)

Definition at line 2440 of file mymalloc.cc.

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

Definition at line 2779 of file mymalloc.cc.

#define SPIN_LOCKS_AVAILABLE   0

Definition at line 541 of file mymalloc.cc.

#define STRUCT_MALLINFO_DECLARED   1

Definition at line 706 of file mymalloc.cc.

#define SYS_ALLOC_PADDING   (TOP_FOOT_SIZE + MALLOC_ALIGNMENT)

Definition at line 2544 of file mymalloc.cc.

#define TOP_FOOT_SIZE   (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE)

Definition at line 2588 of file mymalloc.cc.

#define treebin_at (   M,
 
)    (&((M)->treebins[i]))

Definition at line 2689 of file mymalloc.cc.

#define TREEBIN_SHIFT   (8U)

Definition at line 2441 of file mymalloc.cc.

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

Definition at line 2783 of file mymalloc.cc.

#define TWO_SIZE_T_SIZES   (SIZE_T_SIZE<<1)

Definition at line 1450 of file mymalloc.cc.

#define unlink_chunk (   M,
  P,
 
)
Value:
if (is_small(S)) unlink_small_chunk(M, P, S)\
struct malloc_tree_chunk * tchunkptr
Definition: mymalloc.cc:2276
#define is_small(s)
Definition: mymalloc.cc:2682
#define unlink_large_chunk(M, X)
Definition: mymalloc.cc:3556
#define unlink_small_chunk(M, P, S)
Definition: mymalloc.cc:3434

Definition at line 3633 of file mymalloc.cc.

#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))) {\
B->fd = F;\
F->bk = B;\
}\
}\
}
#define CORRUPTION_ERROR_ACTION(m)
Definition: mymalloc.cc:2638
struct malloc_chunk * mchunkptr
Definition: mymalloc.cc:2065
#define small_index2size(i)
Definition: mymalloc.cc:2684
#define assert(x)
Definition: mymalloc.cc:1309
#define chunksize(p)
Definition: mymalloc.cc:2134
#define clear_smallmap(M, i)
Definition: mymalloc.cc:2778
if(nlines<=0)
struct malloc_chunk * fd
Definition: mymalloc.cc:2060
#define ok_address(M, a)
Definition: mymalloc.cc:2868
#define RTCHECK(e)
Definition: mymalloc.cc:2896

Definition at line 3454 of file mymalloc.cc.

#define unlink_large_chunk (   M,
  X 
)

Definition at line 3556 of file mymalloc.cc.

#define unlink_small_chunk (   M,
  P,
 
)
Value:
{\
mchunkptr F = P->fd;\
mchunkptr B = P->bk;\
assert(P != B);\
assert(P != F);\
if (F == B)\
else if (RTCHECK((F == smallbin_at(M,I) || ok_address(M, F)) &&\
(B == smallbin_at(M,I) || ok_address(M, B)))) {\
F->bk = B;\
B->fd = F;\
}\
}\
}
#define CORRUPTION_ERROR_ACTION(m)
Definition: mymalloc.cc:2638
struct malloc_chunk * mchunkptr
Definition: mymalloc.cc:2065
struct malloc_chunk * bk
Definition: mymalloc.cc:2061
#define small_index2size(i)
Definition: mymalloc.cc:2684
#define assert(x)
Definition: mymalloc.cc:1309
#define smallbin_at(M, i)
Definition: mymalloc.cc:2688
unsigned int bindex_t
Definition: mymalloc.cc:2067
#define chunksize(p)
Definition: mymalloc.cc:2134
#define clear_smallmap(M, i)
Definition: mymalloc.cc:2778
if(nlines<=0)
struct malloc_chunk * fd
Definition: mymalloc.cc:2060
#define small_index(s)
Definition: mymalloc.cc:2683
#define ok_address(M, a)
Definition: mymalloc.cc:2868
#define RTCHECK(e)
Definition: mymalloc.cc:2896

Definition at line 3434 of file mymalloc.cc.

#define USAGE_ERROR_ACTION (   m,
  p 
)    ABORT

Definition at line 2642 of file mymalloc.cc.

#define USE_BUILTIN_FFS   0

Definition at line 647 of file mymalloc.cc.

#define USE_DEV_RANDOM   0

Definition at line 650 of file mymalloc.cc.

#define use_lock (   M)    ((M)->mflags & USE_LOCK_BIT)

Definition at line 2510 of file mymalloc.cc.

#define USE_LOCK_BIT   (0U)

Definition at line 1903 of file mymalloc.cc.

#define USE_LOCKS   0

Definition at line 575 of file mymalloc.cc.

#define use_mmap (   M)    ((M)->mflags & USE_MMAP_BIT)

Definition at line 2514 of file mymalloc.cc.

#define USE_MMAP_BIT   (SIZE_T_ONE)

Define CALL_MMAP/CALL_MUNMAP/CALL_DIRECT_MMAP

Definition at line 1568 of file mymalloc.cc.

#define use_noncontiguous (   M)    ((M)->mflags & USE_NONCONTIGUOUS_BIT)

Definition at line 2518 of file mymalloc.cc.

#define USE_NONCONTIGUOUS_BIT   (4U)

Definition at line 1610 of file mymalloc.cc.

#define USE_SPIN_LOCKS   0

Definition at line 581 of file mymalloc.cc.

Typedef Documentation

typedef unsigned int bindex_t

Definition at line 2067 of file mymalloc.cc.

typedef unsigned int binmap_t

Definition at line 2068 of file mymalloc.cc.

typedef unsigned int flag_t

Definition at line 2069 of file mymalloc.cc.

typedef struct malloc_chunk mchunk

Definition at line 2064 of file mymalloc.cc.

typedef struct malloc_chunk* mchunkptr

Definition at line 2065 of file mymalloc.cc.

typedef struct malloc_segment msegment

Definition at line 2349 of file mymalloc.cc.

typedef struct malloc_segment* msegmentptr

Definition at line 2350 of file mymalloc.cc.

typedef void* mspace

Definition at line 1123 of file mymalloc.cc.

typedef struct malloc_state* mstate

Definition at line 2470 of file mymalloc.cc.

typedef struct malloc_chunk* sbinptr

Definition at line 2066 of file mymalloc.cc.

typedef struct malloc_tree_chunk* tbinptr

Definition at line 2277 of file mymalloc.cc.

typedef struct malloc_tree_chunk tchunk

Definition at line 2275 of file mymalloc.cc.

typedef struct malloc_tree_chunk* tchunkptr

Definition at line 2276 of file mymalloc.cc.

Function Documentation

mspace create_mspace ( size_t  capacity,
int  locked 
)

Definition at line 4974 of file mymalloc.cc.

Here is the caller graph for this function:

mspace create_mspace_with_base ( void base,
size_t  capacity,
int  locked 
)

Definition at line 5005 of file mymalloc.cc.

size_t destroy_mspace ( mspace  msp)

Definition at line 5034 of file mymalloc.cc.

void* dlcalloc ( size_t  n_elements,
size_t  elem_size 
)

Definition at line 4837 of file mymalloc.cc.

void dlfree ( void mem)

Definition at line 4728 of file mymalloc.cc.

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

Definition at line 4879 of file mymalloc.cc.

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

Definition at line 4885 of file mymalloc.cc.

struct mallinfo dlmallinfo ( void  )

Definition at line 4923 of file mymalloc.cc.

void* dlmalloc ( size_t  bytes)

Definition at line 4592 of file mymalloc.cc.

size_t dlmalloc_footprint ( void  )

Definition at line 4914 of file mymalloc.cc.

size_t dlmalloc_max_footprint ( void  )

Definition at line 4918 of file mymalloc.cc.

void dlmalloc_stats ( void  )
int dlmalloc_trim ( size_t  pad)

Definition at line 4904 of file mymalloc.cc.

size_t dlmalloc_usable_size ( void mem)

Definition at line 4938 of file mymalloc.cc.

int dlmallopt ( int  param_number,
int  value 
)

Definition at line 4932 of file mymalloc.cc.

void* dlmemalign ( size_t  alignment,
size_t  bytes 
)

Definition at line 4875 of file mymalloc.cc.

void* dlpvalloc ( size_t  bytes)

Definition at line 4897 of file mymalloc.cc.

void* dlrealloc ( void oldmem,
size_t  bytes 
)

Definition at line 4852 of file mymalloc.cc.

void* dlvalloc ( size_t  bytes)

Definition at line 4890 of file mymalloc.cc.

void* mspace_calloc ( mspace  msp,
size_t  n_elements,
size_t  elem_size 
)

Definition at line 5276 of file mymalloc.cc.

Here is the caller graph for this function:

size_t mspace_footprint ( mspace  msp)

Definition at line 5375 of file mymalloc.cc.

void mspace_free ( mspace  msp,
void mem 
)

Definition at line 5175 of file mymalloc.cc.

Here is the caller graph for this function:

void** mspace_independent_calloc ( mspace  msp,
size_t  n_elements,
size_t  elem_size,
void chunks[] 
)

Definition at line 5329 of file mymalloc.cc.

void** mspace_independent_comalloc ( mspace  msp,
size_t  n_elements,
size_t  sizes[],
void chunks[] 
)

Definition at line 5340 of file mymalloc.cc.

struct mallinfo mspace_mallinfo ( mspace  msp)

Definition at line 5402 of file mymalloc.cc.

void* mspace_malloc ( mspace  msp,
size_t  bytes 
)

Definition at line 5061 of file mymalloc.cc.

Here is the caller graph for this function:

void mspace_malloc_stats ( mspace  msp)

Definition at line 5365 of file mymalloc.cc.

int mspace_mallopt ( int  param_number,
int  value 
)

Definition at line 5420 of file mymalloc.cc.

size_t mspace_max_footprint ( mspace  msp)

Definition at line 5388 of file mymalloc.cc.

void* mspace_memalign ( mspace  msp,
size_t  alignment,
size_t  bytes 
)

Definition at line 5320 of file mymalloc.cc.

void* mspace_realloc ( mspace  msp,
void mem,
size_t  newsize 
)

Definition at line 5296 of file mymalloc.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int mspace_track_large_chunks ( mspace  msp,
int  enable 
)

Definition at line 5019 of file mymalloc.cc.

int mspace_trim ( mspace  msp,
size_t  pad 
)

Definition at line 5350 of file mymalloc.cc.

size_t mspace_usable_size ( void mem)

Definition at line 5411 of file mymalloc.cc.