libgpac
Documentation of the core library of GPAC
dlmalloc.c File Reference
#include <sys/types.h>
#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 dlmalloc.c:

Data Structures

struct  mallinfo
 
struct  sbinptr
 
struct  tbinptr
 
struct  msegmentptr
 
struct  mstate
 
struct  malloc_params
 

Macros

#define USE_LOCK   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 MSPACES   0
 
#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 USE_DL_PREFIX
 
#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)   dlmalloc(b)
 
#define internal_free(m, mem)   dlfree(mem)
 
#define fm   gm
 

Typedefs

typedef unsigned int bindex_t
 
typedef unsigned int binmap_t
 
typedef unsigned int flag_t
 

Functions

void * dlmalloc (size_t)
 
void dlfree (void *)
 
void * dlcalloc (size_t, size_t)
 
void * dlrealloc (void *, size_t)
 
void * dlmemalign (size_t, size_t)
 
void * dlvalloc (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 **)
 
void * dlpvalloc (size_t)
 
int dlmalloc_trim (size_t)
 
void dlmalloc_stats (void)
 
size_t dlmalloc_usable_size (void *)
 
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 mallinfo 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)
 
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 * tmalloc_large (mstate m, size_t nb)
 
static void * tmalloc_small (mstate m, size_t nb)
 
static void * internal_realloc (mstate m, void *oldmem, size_t bytes)
 
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[])
 
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[])
 

Variables

static int dev_zero_fd = -1
 
static struct malloc_params mparams
 
static struct malloc_state _gm_
 

Data Structure Documentation

◆ mallinfo

◆ malloc_chunk

struct malloc_chunk
+ Collaboration diagram for sbinptr:
Data Fields
size_t prev_foot
size_t head
struct malloc_chunk * fd
struct malloc_chunk * bk

◆ malloc_tree_chunk

struct malloc_tree_chunk
+ Collaboration diagram for tbinptr:
Data Fields
size_t prev_foot
size_t head
struct malloc_tree_chunk * fd
struct malloc_tree_chunk * bk
struct malloc_tree_chunk * child[2]
struct malloc_tree_chunk * parent
bindex_t index

◆ malloc_segment

struct malloc_segment
+ Collaboration diagram for msegmentptr:
Data Fields
char * base
size_t size
struct malloc_segment * next
flag_t sflags

◆ malloc_state

struct malloc_state
Data Fields
binmap_t smallmap
binmap_t treemap
size_t dvsize
size_t topsize
char * least_addr
mchunkptr dv
mchunkptr top
size_t trim_check
size_t release_checks
size_t magic
mchunkptr smallbins[(NSMALLBINS+1) *2]
tbinptr treebins[NTREEBINS]
size_t footprint
size_t max_footprint
flag_t mflags
msegment seg
void * extp
size_t exts

◆ malloc_params

struct malloc_params
Data Fields
volatile size_t magic
size_t page_size
size_t granularity
size_t mmap_threshold
size_t trim_threshold
flag_t default_mflags

Macro Definition Documentation

◆ USE_LOCK

#define USE_LOCK   1

◆ DLMALLOC_VERSION

#define DLMALLOC_VERSION   20804

◆ SPIN_LOCKS_AVAILABLE

#define SPIN_LOCKS_AVAILABLE   0

◆ MAX_SIZE_T

#define MAX_SIZE_T   (~(size_t)0)

◆ ONLY_MSPACES

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

◆ MSPACES

#define MSPACES   0

◆ MALLOC_ALIGNMENT

#define MALLOC_ALIGNMENT   ((size_t)8U)

◆ FOOTERS

#define FOOTERS   0

◆ ABORT

#define ABORT   abort()

◆ ABORT_ON_ASSERT_FAILURE

#define ABORT_ON_ASSERT_FAILURE   1

◆ PROCEED_ON_ERROR

#define PROCEED_ON_ERROR   0

◆ USE_LOCKS

#define USE_LOCKS   0

◆ USE_SPIN_LOCKS

#define USE_SPIN_LOCKS   0

◆ INSECURE

#define INSECURE   0

◆ HAVE_MMAP

#define HAVE_MMAP   1

◆ MMAP_CLEARS

#define MMAP_CLEARS   1

◆ HAVE_MREMAP

#define HAVE_MREMAP   0

◆ MALLOC_FAILURE_ACTION

#define MALLOC_FAILURE_ACTION   errno = ENOMEM;

◆ HAVE_MORECORE

#define HAVE_MORECORE   1

◆ MORECORE_DEFAULT

#define MORECORE_DEFAULT   sbrk

◆ MORECORE_CONTIGUOUS

#define MORECORE_CONTIGUOUS   1

◆ DEFAULT_GRANULARITY

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

◆ DEFAULT_TRIM_THRESHOLD

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

◆ DEFAULT_MMAP_THRESHOLD

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

◆ MAX_RELEASE_CHECK_RATE

#define MAX_RELEASE_CHECK_RATE   4095

◆ USE_BUILTIN_FFS

#define USE_BUILTIN_FFS   0

◆ USE_DEV_RANDOM

#define USE_DEV_RANDOM   0

◆ NO_MALLINFO

#define NO_MALLINFO   0

◆ MALLINFO_FIELD_TYPE

#define MALLINFO_FIELD_TYPE   size_t

◆ NO_SEGMENT_TRAVERSAL

#define NO_SEGMENT_TRAVERSAL   0

◆ M_TRIM_THRESHOLD

#define M_TRIM_THRESHOLD   (-1)

◆ M_GRANULARITY

#define M_GRANULARITY   (-2)

◆ M_MMAP_THRESHOLD

#define M_MMAP_THRESHOLD   (-3)

◆ STRUCT_MALLINFO_DECLARED

#define STRUCT_MALLINFO_DECLARED   1

◆ NOINLINE

#define NOINLINE

◆ FORCEINLINE

#define FORCEINLINE

◆ USE_DL_PREFIX

#define USE_DL_PREFIX

◆ assert

#define assert (   x)

◆ DEBUG

#define DEBUG   0

◆ malloc_getpagesize

#define malloc_getpagesize   ((size_t)4096U)

◆ SIZE_T_SIZE

#define SIZE_T_SIZE   (sizeof(size_t))

◆ SIZE_T_BITSIZE

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

◆ SIZE_T_ZERO

#define SIZE_T_ZERO   ((size_t)0)

◆ SIZE_T_ONE

#define SIZE_T_ONE   ((size_t)1)

◆ SIZE_T_TWO

#define SIZE_T_TWO   ((size_t)2)

◆ SIZE_T_FOUR

#define SIZE_T_FOUR   ((size_t)4)

◆ TWO_SIZE_T_SIZES

#define TWO_SIZE_T_SIZES   (SIZE_T_SIZE<<1)

◆ FOUR_SIZE_T_SIZES

#define FOUR_SIZE_T_SIZES   (SIZE_T_SIZE<<2)

◆ SIX_SIZE_T_SIZES

#define SIX_SIZE_T_SIZES   (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES)

◆ HALF_MAX_SIZE_T

#define HALF_MAX_SIZE_T   (MAX_SIZE_T / 2U)

◆ CHUNK_ALIGN_MASK

#define CHUNK_ALIGN_MASK   (MALLOC_ALIGNMENT - SIZE_T_ONE)

◆ is_aligned

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

◆ align_offset

#define align_offset (   A)
Value:
((((size_t)(A) & CHUNK_ALIGN_MASK) == 0)? 0 :\
#define MALLOC_ALIGNMENT
Definition: dlmalloc.c:565
#define CHUNK_ALIGN_MASK
Definition: dlmalloc.c:1466
#define A
Definition: md5.c:27

◆ MFAIL

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

◆ CMFAIL

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

◆ MUNMAP_DEFAULT

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

◆ MMAP_PROT

#define MMAP_PROT   (PROT_READ|PROT_WRITE)

◆ MMAP_FLAGS

#define MMAP_FLAGS   (MAP_PRIVATE)

◆ MMAP_DEFAULT

#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))
static int dev_zero_fd
Definition: dlmalloc.c:1506
#define MMAP_PROT
Definition: dlmalloc.c:1493
#define MMAP_FLAGS
Definition: dlmalloc.c:1505

◆ DIRECT_MMAP_DEFAULT

#define DIRECT_MMAP_DEFAULT (   s)    MMAP_DEFAULT(s)

◆ CALL_MORECORE

#define CALL_MORECORE (   S)    MORECORE_DEFAULT(S)

Define CALL_MORECORE

◆ USE_MMAP_BIT

#define USE_MMAP_BIT   (SIZE_T_ONE)

Define CALL_MMAP/CALL_MUNMAP/CALL_DIRECT_MMAP

◆ CALL_MMAP

#define CALL_MMAP (   s)    MMAP_DEFAULT(s)

◆ CALL_MUNMAP

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

◆ CALL_DIRECT_MMAP

#define CALL_DIRECT_MMAP (   s)    DIRECT_MMAP_DEFAULT(s)

◆ CALL_MREMAP

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

Define CALL_MREMAP

◆ USE_NONCONTIGUOUS_BIT

#define USE_NONCONTIGUOUS_BIT   (4U)

◆ EXTERN_BIT

#define EXTERN_BIT   (8U)

◆ USE_LOCK_BIT

#define USE_LOCK_BIT   (0U)

◆ INITIAL_LOCK

#define INITIAL_LOCK (   l)

◆ ACQUIRE_MALLOC_GLOBAL_LOCK

#define ACQUIRE_MALLOC_GLOBAL_LOCK ( )

◆ RELEASE_MALLOC_GLOBAL_LOCK

#define RELEASE_MALLOC_GLOBAL_LOCK ( )

◆ MCHUNK_SIZE

#define MCHUNK_SIZE   (sizeof(mchunk))

◆ CHUNK_OVERHEAD

#define CHUNK_OVERHEAD   (SIZE_T_SIZE)

◆ MMAP_CHUNK_OVERHEAD

#define MMAP_CHUNK_OVERHEAD   (TWO_SIZE_T_SIZES)

◆ MMAP_FOOT_PAD

#define MMAP_FOOT_PAD   (FOUR_SIZE_T_SIZES)

◆ MIN_CHUNK_SIZE

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

◆ chunk2mem

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

◆ mem2chunk

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

◆ align_as_chunk

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

◆ MAX_REQUEST

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

◆ MIN_REQUEST

#define MIN_REQUEST   (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE)

◆ pad_request

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

◆ request2size

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

◆ PINUSE_BIT

#define PINUSE_BIT   (SIZE_T_ONE)

◆ CINUSE_BIT

#define CINUSE_BIT   (SIZE_T_TWO)

◆ FLAG4_BIT

#define FLAG4_BIT   (SIZE_T_FOUR)

◆ INUSE_BITS

#define INUSE_BITS   (PINUSE_BIT|CINUSE_BIT)

◆ FLAG_BITS

#define FLAG_BITS   (PINUSE_BIT|CINUSE_BIT|FLAG4_BIT)

◆ FENCEPOST_HEAD

#define FENCEPOST_HEAD   (INUSE_BITS|SIZE_T_SIZE)

◆ cinuse

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

◆ pinuse

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

◆ is_inuse

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

◆ is_mmapped

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

◆ chunksize

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

◆ clear_pinuse

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

◆ chunk_plus_offset

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

◆ chunk_minus_offset

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

◆ next_chunk

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

◆ prev_chunk

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

◆ next_pinuse

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

◆ get_foot

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

◆ set_foot

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

◆ set_size_and_pinuse_of_free_chunk

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

◆ set_free_with_pinuse

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

◆ overhead_for

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

◆ calloc_must_clear

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

◆ leftmost_child

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

◆ is_mmapped_segment

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

◆ is_extern_segment

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

◆ NSMALLBINS

#define NSMALLBINS   (32U)

◆ NTREEBINS

#define NTREEBINS   (32U)

◆ SMALLBIN_SHIFT

#define SMALLBIN_SHIFT   (3U)

◆ SMALLBIN_WIDTH

#define SMALLBIN_WIDTH   (SIZE_T_ONE << SMALLBIN_SHIFT)

◆ TREEBIN_SHIFT

#define TREEBIN_SHIFT   (8U)

◆ MIN_LARGE_SIZE

#define MIN_LARGE_SIZE   (SIZE_T_ONE << TREEBIN_SHIFT)

◆ MAX_SMALL_SIZE

#define MAX_SMALL_SIZE   (MIN_LARGE_SIZE - SIZE_T_ONE)

◆ MAX_SMALL_REQUEST

#define MAX_SMALL_REQUEST   (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD)

◆ ensure_initialization

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

◆ gm

#define gm   (&_gm_)

◆ is_global

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

◆ is_initialized

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

◆ use_lock

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

◆ enable_lock

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

◆ disable_lock

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

◆ use_mmap

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

◆ enable_mmap

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

◆ disable_mmap

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

◆ use_noncontiguous

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

◆ disable_contiguous

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

◆ set_lock

#define set_lock (   M,
  L 
)
Value:
((M)->mflags = (L)?\
((M)->mflags | USE_LOCK_BIT) :\
((M)->mflags & ~USE_LOCK_BIT))
#define USE_LOCK_BIT
Definition: dlmalloc.c:1913
#define M(id)
Definition: libunicode.c:1075
@ L
Definition: uni_bidi.c:42

◆ page_align

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

◆ granularity_align

#define granularity_align (   S)
Value:
#define SIZE_T_ONE
Definition: dlmalloc.c:1457
size_t granularity
Definition: dlmalloc.c:2494
static struct malloc_params mparams
Definition: dlmalloc.c:2500
@ S
Definition: uni_bidi.c:56

◆ mmap_align

#define mmap_align (   S)    page_align(S)

◆ SYS_ALLOC_PADDING

#define SYS_ALLOC_PADDING   (TOP_FOOT_SIZE + MALLOC_ALIGNMENT)

◆ is_page_aligned

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

◆ is_granularity_aligned

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

◆ segment_holds

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

◆ should_trim

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

◆ TOP_FOOT_SIZE

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

◆ PREACTION

#define PREACTION (   M)    (0)

◆ POSTACTION

#define POSTACTION (   M)

◆ CORRUPTION_ERROR_ACTION

#define CORRUPTION_ERROR_ACTION (   m)    ABORT

◆ USAGE_ERROR_ACTION

#define USAGE_ERROR_ACTION (   m,
 
)    ABORT

◆ check_free_chunk

#define check_free_chunk (   M,
 
)

◆ check_inuse_chunk

#define check_inuse_chunk (   M,
 
)

◆ check_malloced_chunk

#define check_malloced_chunk (   M,
  P,
  N 
)

◆ check_mmapped_chunk

#define check_mmapped_chunk (   M,
 
)

◆ check_malloc_state

#define check_malloc_state (   M)

◆ check_top_chunk

#define check_top_chunk (   M,
 
)

◆ is_small

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

◆ small_index

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

◆ small_index2size

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

◆ MIN_SMALL_INDEX

#define MIN_SMALL_INDEX   (small_index(MIN_CHUNK_SIZE))

◆ smallbin_at

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

◆ treebin_at

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

◆ compute_tree_index

#define compute_tree_index (   S,
  I 
)
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 NTREEBINS
Definition: dlmalloc.c:2448
#define TREEBIN_SHIFT
Definition: dlmalloc.c:2451
static u32 K[]
Definition: md5.c:37
@ N
Definition: uni_bidi.c:68

◆ bit_for_tree_index

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

◆ leftshift_for_tree_index

#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_BITSIZE
Definition: dlmalloc.c:1452

◆ minsize_for_tree_index

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

◆ idx2bit

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

◆ mark_smallmap

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

◆ clear_smallmap

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

◆ smallmap_is_marked

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

◆ mark_treemap

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

◆ clear_treemap

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

◆ treemap_is_marked

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

◆ least_bit

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

◆ left_bits

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

◆ same_or_left_bits

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

◆ compute_bit2idx

#define compute_bit2idx (   X,
  I 
)
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:2077

◆ ok_address

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

◆ ok_next

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

◆ ok_inuse

#define ok_inuse (   p)    is_inuse(p)

◆ ok_pinuse

#define ok_pinuse (   p)    pinuse(p)

◆ ok_magic

#define ok_magic (   M)    (1)

◆ RTCHECK

#define RTCHECK (   e)    (e)

◆ mark_inuse_foot

#define mark_inuse_foot (   M,
  p,
 
)

◆ set_inuse

#define set_inuse (   M,
  p,
 
)
Value:
((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\
((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT)
#define CINUSE_BIT
Definition: dlmalloc.c:2130
#define PINUSE_BIT
Definition: dlmalloc.c:2129

◆ set_inuse_and_pinuse

#define set_inuse_and_pinuse (   M,
  p,
 
)
Value:
((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\
((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT)

◆ set_size_and_pinuse_of_inuse_chunk

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

◆ insert_small_chunk

#define insert_small_chunk (   M,
  P,
  S 
)
Value:
{\
bindex_t I = (bindex_t)small_index(S);\
mchunkptr B = smallbin_at(M, I);\
mchunkptr F = B;\
assert(S >= MIN_CHUNK_SIZE);\
mark_smallmap(M, I);\
else if (RTCHECK(ok_address(M, B->fd)))\
F = B->fd;\
else {\
CORRUPTION_ERROR_ACTION(M);\
}\
B->fd = P;\
F->bk = P;\
P->fd = F;\
P->bk = B;\
}
#define ok_address(M, a)
Definition: dlmalloc.c:2878
#define small_index(s)
Definition: dlmalloc.c:2693
#define smallmap_is_marked(M, i)
Definition: dlmalloc.c:2789
#define smallbin_at(M, i)
Definition: dlmalloc.c:2698
#define MIN_CHUNK_SIZE
Definition: dlmalloc.c:2097
#define RTCHECK(e)
Definition: dlmalloc.c:2906
#define I(X, Y, Z)
Definition: md5.c:72
#define F(X, Y, Z)
Definition: md5.c:69
@ B
Definition: uni_bidi.c:58

◆ unlink_small_chunk

#define unlink_small_chunk (   M,
  P,
  S 
)
Value:
{\
mchunkptr F = P->fd;\
mchunkptr B = P->bk;\
bindex_t I = small_index(S);\
assert(P != B);\
assert(P != F);\
assert(chunksize(P) == small_index2size(I));\
if (F == B)\
clear_smallmap(M, I);\
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;\
}\
else {\
CORRUPTION_ERROR_ACTION(M);\
}\
}
#define chunksize(p)
Definition: dlmalloc.c:2144
#define small_index2size(i)
Definition: dlmalloc.c:2694

◆ unlink_first_small_chunk

#define unlink_first_small_chunk (   M,
  B,
  P,
  I 
)
Value:
{\
mchunkptr F = P->fd;\
assert(P != B);\
assert(P != F);\
assert(chunksize(P) == small_index2size(I));\
if (B == F)\
clear_smallmap(M, I);\
else if (RTCHECK(ok_address(M, F))) {\
B->fd = F;\
F->bk = B;\
}\
else {\
CORRUPTION_ERROR_ACTION(M);\
}\
}

◆ replace_dv

#define replace_dv (   M,
  P,
  S 
)
Value:
{\
size_t DVS = M->dvsize;\
if (DVS != 0) {\
mchunkptr DV = M->dv;\
assert(is_small(DVS));\
insert_small_chunk(M, DV, DVS);\
}\
M->dvsize = S;\
M->dv = P;\
}
#define is_small(s)
Definition: dlmalloc.c:2692

◆ insert_large_chunk

#define insert_large_chunk (   M,
  X,
  S 
)

◆ unlink_large_chunk

#define unlink_large_chunk (   M,
 
)

◆ insert_chunk

#define insert_chunk (   M,
  P,
  S 
)
Value:
else { tchunkptr TP = (tchunkptr)(P); insert_large_chunk(M, TP, S); }
#define insert_large_chunk(M, X, S)
Definition: dlmalloc.c:3498
#define insert_small_chunk(M, P, S)
Definition: dlmalloc.c:3425

◆ unlink_chunk

#define unlink_chunk (   M,
  P,
  S 
)
Value:
else { tchunkptr TP = (tchunkptr)(P); unlink_large_chunk(M, TP); }
#define unlink_large_chunk(M, X)
Definition: dlmalloc.c:3566
#define unlink_small_chunk(M, P, S)
Definition: dlmalloc.c:3444

◆ internal_malloc

#define internal_malloc (   m,
 
)    dlmalloc(b)

◆ internal_free

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

◆ fm

#define fm   gm

Typedef Documentation

◆ bindex_t

typedef unsigned int bindex_t

◆ binmap_t

typedef unsigned int binmap_t

◆ flag_t

typedef unsigned int flag_t

Function Documentation

◆ dlmalloc()

void * dlmalloc ( size_t  bytes)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dlfree()

void dlfree ( void *  mem)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dlcalloc()

void * dlcalloc ( size_t  n_elements,
size_t  elem_size 
)
+ Here is the call graph for this function:

◆ dlrealloc()

void * dlrealloc ( void *  oldmem,
size_t  bytes 
)
+ Here is the call graph for this function:

◆ dlmemalign()

void * dlmemalign ( size_t  alignment,
size_t  bytes 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dlvalloc()

void * dlvalloc ( size_t  bytes)
+ Here is the call graph for this function:

◆ dlmallopt()

int dlmallopt ( int  param_number,
int  value 
)
+ Here is the call graph for this function:

◆ dlmalloc_footprint()

size_t dlmalloc_footprint ( void  )

◆ dlmalloc_max_footprint()

size_t dlmalloc_max_footprint ( void  )

◆ dlmallinfo()

struct mallinfo dlmallinfo ( void  )

◆ dlindependent_calloc() [1/2]

void** dlindependent_calloc ( size_t  ,
size_t  ,
void **   
)

◆ dlindependent_comalloc() [1/2]

void** dlindependent_comalloc ( size_t  ,
size_t *  ,
void **   
)

◆ dlpvalloc()

void * dlpvalloc ( size_t  bytes)
+ Here is the call graph for this function:

◆ dlmalloc_trim()

int dlmalloc_trim ( size_t  pad)
+ Here is the call graph for this function:

◆ dlmalloc_stats()

void dlmalloc_stats ( void  )
+ Here is the call graph for this function:

◆ dlmalloc_usable_size()

size_t dlmalloc_usable_size ( void *  mem)

◆ segment_holding()

static msegmentptr segment_holding ( mstate  m,
char *  addr 
)
static
+ Here is the caller graph for this function:

◆ has_segment_link()

static int has_segment_link ( mstate  m,
msegmentptr  ss 
)
static
+ Here is the caller graph for this function:

◆ init_mparams()

static int init_mparams ( void  )
static
+ Here is the call graph for this function:

◆ change_mparam()

static int change_mparam ( int  param_number,
int  value 
)
static
+ Here is the caller graph for this function:

◆ internal_mallinfo()

static struct mallinfo internal_mallinfo ( mstate  m)
static

◆ internal_malloc_stats()

static void internal_malloc_stats ( mstate  m)
static
+ Here is the caller graph for this function:

◆ mmap_alloc()

static void* mmap_alloc ( mstate  m,
size_t  nb 
)
static
+ Here is the caller graph for this function:

◆ mmap_resize()

static mchunkptr mmap_resize ( mstate  m,
mchunkptr  oldp,
size_t  nb 
)
static
+ Here is the caller graph for this function:

◆ init_top()

static void init_top ( mstate  m,
mchunkptr  p,
size_t  psize 
)
static
+ Here is the caller graph for this function:

◆ init_bins()

static void init_bins ( mstate  m)
static
+ Here is the caller graph for this function:

◆ prepend_alloc()

static void* prepend_alloc ( mstate  m,
char *  newbase,
char *  oldbase,
size_t  nb 
)
static
+ Here is the caller graph for this function:

◆ add_segment()

static void add_segment ( mstate  m,
char *  tbase,
size_t  tsize,
flag_t  mmapped 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sys_alloc()

static void* sys_alloc ( mstate  m,
size_t  nb 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ release_unused_segments()

static size_t release_unused_segments ( mstate  m)
static
+ Here is the caller graph for this function:

◆ sys_trim()

static int sys_trim ( mstate  m,
size_t  pad 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tmalloc_large()

static void* tmalloc_large ( mstate  m,
size_t  nb 
)
static
+ Here is the caller graph for this function:

◆ tmalloc_small()

static void* tmalloc_small ( mstate  m,
size_t  nb 
)
static
+ Here is the caller graph for this function:

◆ internal_realloc()

static void* internal_realloc ( mstate  m,
void *  oldmem,
size_t  bytes 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ internal_memalign()

static void* internal_memalign ( mstate  m,
size_t  alignment,
size_t  bytes 
)
static
+ Here is the caller graph for this function:

◆ ialloc()

static void** ialloc ( mstate  m,
size_t  n_elements,
size_t *  sizes,
int  opts,
void *  chunks[] 
)
static
+ Here is the caller graph for this function:

◆ dlindependent_calloc() [2/2]

void** dlindependent_calloc ( size_t  n_elements,
size_t  elem_size,
void *  chunks[] 
)
+ Here is the call graph for this function:

◆ dlindependent_comalloc() [2/2]

void** dlindependent_comalloc ( size_t  n_elements,
size_t  sizes[],
void *  chunks[] 
)
+ Here is the call graph for this function:

Variable Documentation

◆ dev_zero_fd

int dev_zero_fd = -1
static

◆ mparams

struct malloc_params mparams
static

◆ _gm_

struct malloc_state _gm_
static