#include <sys/types.h>#include <stdio.h>#include <errno.h>#include <stdlib.h>#include <string.h>#include <sys/mman.h>#include <fcntl.h>#include <unistd.h>#include <sys/param.h>


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 |
Defines | |
| #define | DLMALLOC_VERSION 20804 |
| #define | MAX_SIZE_T (~(size_t)0) |
| #define | ONLY_MSPACES 0 |
| #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) |
| #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 | dlcalloc calloc |
| #define | dlfree free |
| #define | dlmalloc malloc |
| #define | dlmemalign memalign |
| #define | dlrealloc realloc |
| #define | dlvalloc valloc |
| #define | dlpvalloc pvalloc |
| #define | dlmallinfo mallinfo |
| #define | dlmallopt mallopt |
| #define | dlmalloc_trim malloc_trim |
| #define | dlmalloc_stats malloc_stats |
| #define | dlmalloc_usable_size malloc_usable_size |
| #define | dlmalloc_footprint malloc_footprint |
| #define | dlmalloc_max_footprint malloc_max_footprint |
| #define | dlindependent_calloc independent_calloc |
| #define | dlindependent_comalloc independent_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)) |
| #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 | IS_MMAPPED_BIT (SIZE_T_ONE) |
| #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 | chunksize(p) ((p)->head & ~(FLAG_BITS)) |
| #define | clear_pinuse(p) ((p)->head &= ~PINUSE_BIT) |
| #define | clear_cinuse(p) ((p)->head &= ~CINUSE_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 | is_mmapped(p) (!((p)->head & PINUSE_BIT) && ((p)->prev_foot & IS_MMAPPED_BIT)) |
| #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 & IS_MMAPPED_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() (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_cinuse(p) cinuse(p) |
| #define | ok_pinuse(p) pinuse(p) |
| #define | ok_magic(M) (1) |
| #define | RTCHECK(e) (e) |
| #define | mark_inuse_foot(M, p, s) |
| #define | set_inuse(M, p, s) |
| #define | set_inuse_and_pinuse(M, p, s) |
| #define | set_size_and_pinuse_of_inuse_chunk(M, p, s) ((p)->head = (s|PINUSE_BIT|CINUSE_BIT)) |
| #define | insert_small_chunk(M, P, S) |
| #define | unlink_small_chunk(M, P, S) |
| #define | unlink_first_small_chunk(M, B, P, I) |
| #define | replace_dv(M, P, S) |
| #define | insert_large_chunk(M, X, S) |
| #define | unlink_large_chunk(M, X) |
| #define | insert_chunk(M, P, S) |
| #define | unlink_chunk(M, P, S) |
| #define | internal_malloc(m, b) dlmalloc(b) |
| #define | internal_free(m, mem) dlfree(mem) |
| #define | fm gm |
Typedefs | |
| typedef struct malloc_chunk | mchunk |
| typedef struct malloc_chunk * | mchunkptr |
| typedef struct malloc_chunk * | sbinptr |
| typedef unsigned int | bindex_t |
| typedef unsigned int | binmap_t |
| typedef unsigned int | flag_t |
| typedef struct malloc_tree_chunk | tchunk |
| typedef struct malloc_tree_chunk * | tchunkptr |
| typedef struct malloc_tree_chunk * | tbinptr |
| typedef struct malloc_segment | msegment |
| typedef struct malloc_segment * | msegmentptr |
| typedef struct malloc_state * | mstate |
Functions | |
| 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_ |
| #define ABORT abort() |
| #define ABORT_ON_ASSERT_FAILURE 1 |
Definition at line 560 of file malloc.c.h.
| #define ACQUIRE_MALLOC_GLOBAL_LOCK | ( | ) |
Definition at line 1907 of file malloc.c.h.
Referenced by init_mparams(), InitPool(), sys_alloc(), and sys_trim().
| #define align_as_chunk | ( | A | ) | (mchunkptr)((A) + align_offset(chunk2mem(A))) |
Definition at line 2086 of file malloc.c.h.
Referenced by internal_mallinfo(), internal_malloc_stats(), prepend_alloc(), and release_unused_segments().
| #define align_offset | ( | A | ) |
Value:
((((size_t)(A) & CHUNK_ALIGN_MASK) == 0)? 0 :\ ((MALLOC_ALIGNMENT - ((size_t)(A) & CHUNK_ALIGN_MASK)) & CHUNK_ALIGN_MASK))
Definition at line 1441 of file malloc.c.h.
Referenced by add_segment(), init_top(), and mmap_alloc().
| #define assert | ( | x | ) |
Definition at line 1295 of file malloc.c.h.
Referenced by TiXmlAttributeSet::Add(), add_segment(), GhoulPrimitive::OgreRenderableDrawer::AddIndex(), GhoulPrimitive::OgreRenderableDrawer::AddVertex(), TiXmlString::at(), Lugre::cRobRenderOp::Begin(), Lugre::cCamera::cCamera(), Lugre::cFIFO::cFIFO(), Lugre::cViewport_L::CreateRTTViewport(), Lugre::cFastBatch::cSubBatch::cSubBatch(), Lugre::cWidget::cWidget(), DestroyCaches(), Lugre::cDialog::DestroyWidget(), dlmalloc(), GhoulPrimitive::Primitive::Ellipse(), Lugre::cRobRenderOp::End(), Lugre::explodestr(), GhoulPrimitive::OgreRenderableDrawer::Finish(), Lugre::FreeOldUnusedParticleSystems(), Lugre::cSimpleBeam::getBoundingBox(), Lugre::cSimpleBeam::getBoundingRadius(), TiXmlBase::GetChar(), TiXmlBase::GetEntity(), Lugre::cOgreWrapper::GetEntityVertex(), Lugre::cNet::GetHostByName(), Lugre::MeshShape::GetMeshShape(), GetMSpace(), Lugre::cLuaBindDirect< Ogre::VertexDeclaration >::GetSingletonPtr(), Lugre::cLuaBind< Lugre::cBufferedMesh >::GetSingletonPtr(), Lugre::cSimpleBeam::getSquaredViewDepth(), GetThreadCache(), Lugre::cFIFO::HackGetRawWriter(), ialloc(), Lugre::cRobRenderOp::Index(), Lugre::cScripting::Init(), Lugre::cGfx2D::InitBase(), TiXmlNode::InsertAfterChild(), TiXmlNode::InsertBeforeChild(), internal_memalign(), TiXmlNode::IterateChildren(), l_OgreMaterialAvailable(), TiXmlNode::LinkEndChild(), TiXmlDocument::LoadFile(), Lugre::cLuaBind< Lugre::cBufferedMesh >::LuaRegister(), Lugre::macBundlePath(), Lugre::FindBasePaths::macBundlePath(), mmap_alloc(), nedblksize(), neddisablethreadcache(), nedpfree(), nedprealloc(), Lugre::cGfx3D::NewChildOfGfx3D(), Lugre::cGfx3D::NewChildOfRoot(), Lugre::cGfx3D::NewChildOfSceneNode(), Lugre::cGfx3D::NewFree(), Lugre::cGfx3D::NewOfSceneNode(), Lugre::cGfx3D::NewTagPoint(), TiXmlString::operator[](), TiXmlDocument::Parse(), GhoulPrimitive::OgreRenderableDrawer::Prepare(), Lugre::cRobRenderOp::PrepareAddVertex(), Lugre::cImage_L::PrepareImage(), prepend_alloc(), Lugre::cFIFO::PushRaw(), Lugre::cFIFO::PushRawFill(), TiXmlBase::ReadName(), Lugre::cTimer::RegisterFrameIntervalListener(), Lugre::cListenable::RegisterListener(), Lugre::cScripting::RegisterPlugin(), Lugre::cSmartPointable::RegisterSmartPtr(), cObjectController::Release(), release_unused_segments(), TiXmlAttributeSet::Remove(), RemoveCacheEntries(), TiXmlNode::RemoveChild(), Lugre::cFIFO::Reserve(), Lugre::cUDP_SendSocket::Send(), Lugre::cConnection::SendPush(), Lugre::cFastBatch::cSubBatch::SetDisplayRange(), TiXmlDocument::SetError(), Lugre::cBufferedVertexData::SetFromVertexData(), Lugre::cGfx3D::SetPrepareFrameStep(), Lugre::cGfx2D::SetPrepareFrameStep(), Lugre::cBufferedVertexData::SetQuickDataFromSemantic(), TiXmlParsingData::Stamp(), Lugre::cRobRenderOp::StartCustomWriter(), Lugre::cTimer::StartFrame(), cObject::Step(), Lugre::cConnection::Step(), TiXmlBase::StringEqual(), threadcache_free(), threadcache_malloc(), TiXmlParsingData::TiXmlParsingData(), tmalloc_large(), tmalloc_small(), Lugre::cListenable::UnRegisterListener(), Lugre::cSmartPointable::UnRegisterSmartPtr(), Lugre::cDialog::~cDialog(), cLocation::~cLocation(), cObjectController::~cObjectController(), Lugre::cScripting::~cScripting(), Lugre::cWidget::~cWidget(), and TiXmlAttributeSet::~TiXmlAttributeSet().
| #define bit_for_tree_index | ( | i | ) | (i == NTREEBINS-1)? (SIZE_T_BITSIZE-1) : (((i) >> 1) + TREEBIN_SHIFT - 2) |
Definition at line 2752 of file malloc.c.h.
| #define CALL_DIRECT_MMAP | ( | s | ) | DIRECT_MMAP_DEFAULT(s) |
| #define CALL_MMAP | ( | s | ) | MMAP_DEFAULT(s) |
| #define CALL_MORECORE | ( | S | ) | MORECORE_DEFAULT(S) |
Define CALL_MORECORE
Definition at line 1537 of file malloc.c.h.
Referenced by sys_alloc(), and sys_trim().
| #define CALL_MREMAP | ( | addr, | |||
| osz, | |||||
| nsz, | |||||
| mv | ) | MFAIL |
Define CALL_MREMAP
Definition at line 1587 of file malloc.c.h.
Referenced by mmap_resize(), and sys_trim().
| #define CALL_MUNMAP | ( | a, | |||
| s | ) | MUNMAP_DEFAULT((a), (s)) |
Definition at line 1558 of file malloc.c.h.
Referenced by dlfree(), release_unused_segments(), and sys_trim().
| #define calloc_must_clear | ( | p | ) | (!is_mmapped(p)) |
| #define check_free_chunk | ( | M, | |||
| P | ) |
| #define check_inuse_chunk | ( | M, | |||
| P | ) |
Definition at line 2647 of file malloc.c.h.
Referenced by dlfree(), ialloc(), internal_memalign(), and internal_realloc().
| #define check_malloc_state | ( | M | ) |
Definition at line 2650 of file malloc.c.h.
Referenced by internal_mallinfo(), and internal_malloc_stats().
| #define check_malloced_chunk | ( | M, | |||
| P, | |||||
| N | ) |
Definition at line 2648 of file malloc.c.h.
Referenced by dlmalloc(), prepend_alloc(), and sys_alloc().
| #define check_mmapped_chunk | ( | M, | |||
| P | ) |
| #define check_top_chunk | ( | M, | |||
| P | ) |
Definition at line 2651 of file malloc.c.h.
Referenced by add_segment(), dlmalloc(), prepend_alloc(), sys_alloc(), and sys_trim().
| #define chunk2mem | ( | p | ) | ((void*)((char*)(p) + TWO_SIZE_T_SIZES)) |
Definition at line 2083 of file malloc.c.h.
Referenced by add_segment(), dlmalloc(), ialloc(), init_top(), internal_memalign(), internal_realloc(), mmap_alloc(), nedgetvalue(), prepend_alloc(), sys_alloc(), tmalloc_large(), and tmalloc_small().
| #define CHUNK_ALIGN_MASK (MALLOC_ALIGNMENT - SIZE_T_ONE) |
Definition at line 1435 of file malloc.c.h.
Referenced by add_segment(), mmap_alloc(), and mmap_resize().
| #define chunk_minus_offset | ( | p, | |||
| s | ) | ((mchunkptr)(((char*)(p)) - (s))) |
| #define CHUNK_OVERHEAD (SIZE_T_SIZE) |
Definition at line 2070 of file malloc.c.h.
Referenced by ialloc(), internal_memalign(), nedpfree(), threadcache_free(), and threadcache_malloc().
| #define chunk_plus_offset | ( | p, | |||
| s | ) | ((mchunkptr)(((char*)(p)) + (s))) |
Definition at line 2131 of file malloc.c.h.
Referenced by add_segment(), dlfree(), dlmalloc(), ialloc(), init_top(), internal_memalign(), internal_realloc(), mmap_alloc(), mmap_resize(), prepend_alloc(), sys_alloc(), tmalloc_large(), and tmalloc_small().
| #define chunksize | ( | p | ) | ((p)->head & ~(FLAG_BITS)) |
Definition at line 2125 of file malloc.c.h.
Referenced by dlfree(), dlmalloc(), dlmalloc_usable_size(), ialloc(), internal_mallinfo(), internal_malloc_stats(), internal_memalign(), internal_realloc(), mmap_resize(), nedblksize(), prepend_alloc(), release_unused_segments(), tmalloc_large(), and tmalloc_small().
| #define cinuse | ( | p | ) | ((p)->head & CINUSE_BIT) |
Definition at line 2123 of file malloc.c.h.
Referenced by dlfree(), dlmalloc_usable_size(), internal_mallinfo(), internal_malloc_stats(), nedblksize(), nedgetvalue(), prepend_alloc(), and release_unused_segments().
| #define CINUSE_BIT (SIZE_T_TWO) |
Definition at line 2114 of file malloc.c.h.
Referenced by internal_memalign(), mmap_alloc(), and mmap_resize().
| #define clear_cinuse | ( | p | ) | ((p)->head &= ~CINUSE_BIT) |
Definition at line 2128 of file malloc.c.h.
| #define clear_pinuse | ( | p | ) | ((p)->head &= ~PINUSE_BIT) |
Definition at line 2127 of file malloc.c.h.
| #define clear_smallmap | ( | M, | |||
| i | ) | ((M)->smallmap &= ~idx2bit(i)) |
Definition at line 2773 of file malloc.c.h.
| #define clear_treemap | ( | M, | |||
| i | ) | ((M)->treemap &= ~idx2bit(i)) |
Definition at line 2777 of file malloc.c.h.
| #define CMFAIL ((char*)(MFAIL)) |
Definition at line 1456 of file malloc.c.h.
Referenced by mmap_alloc(), mmap_resize(), sys_alloc(), and sys_trim().
| #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);\
}
Definition at line 2819 of file malloc.c.h.
Referenced by dlmalloc(), tmalloc_large(), and tmalloc_small().
| #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));\
}\
}
Definition at line 2732 of file malloc.c.h.
Referenced by tmalloc_large().
| #define CORRUPTION_ERROR_ACTION | ( | m | ) | ABORT |
| #define DEBUG 0 |
Definition at line 1297 of file malloc.c.h.
| #define DEFAULT_GRANULARITY (0) |
Definition at line 611 of file malloc.c.h.
| #define DEFAULT_MMAP_THRESHOLD ((size_t)256U * (size_t)1024U) |
| #define DEFAULT_TRIM_THRESHOLD ((size_t)2U * (size_t)1024U * (size_t)1024U) |
| #define DIRECT_MMAP_DEFAULT | ( | s | ) | MMAP_DEFAULT(s) |
Definition at line 1482 of file malloc.c.h.
| #define disable_contiguous | ( | M | ) | ((M)->mflags |= USE_NONCONTIGUOUS_BIT) |
| #define disable_lock | ( | M | ) | ((M)->mflags &= ~USE_LOCK_BIT) |
Definition at line 2507 of file malloc.c.h.
| #define disable_mmap | ( | M | ) | ((M)->mflags &= ~USE_MMAP_BIT) |
| #define dlcalloc calloc |
Definition at line 749 of file malloc.c.h.
| #define dlfree free |
| #define dlindependent_calloc independent_calloc |
Definition at line 763 of file malloc.c.h.
| #define dlindependent_comalloc independent_comalloc |
Definition at line 764 of file malloc.c.h.
| #define dlmallinfo mallinfo |
Definition at line 756 of file malloc.c.h.
| #define dlmalloc malloc |
| #define dlmalloc_footprint malloc_footprint |
Definition at line 761 of file malloc.c.h.
| #define dlmalloc_max_footprint malloc_max_footprint |
Definition at line 762 of file malloc.c.h.
| void dlmalloc_stats malloc_stats |
Definition at line 759 of file malloc.c.h.
| #define dlmalloc_trim malloc_trim |
Definition at line 758 of file malloc.c.h.
| #define dlmalloc_usable_size malloc_usable_size |
Definition at line 760 of file malloc.c.h.
| #define DLMALLOC_VERSION 20804 |
Definition at line 484 of file malloc.c.h.
| #define dlmallopt mallopt |
Definition at line 757 of file malloc.c.h.
| #define dlmemalign memalign |
| #define dlpvalloc pvalloc |
Definition at line 755 of file malloc.c.h.
| #define dlrealloc realloc |
Definition at line 753 of file malloc.c.h.
| #define dlvalloc valloc |
Definition at line 754 of file malloc.c.h.
| #define enable_lock | ( | M | ) | ((M)->mflags |= USE_LOCK_BIT) |
Definition at line 2506 of file malloc.c.h.
| #define enable_mmap | ( | M | ) | ((M)->mflags |= USE_MMAP_BIT) |
| #define ensure_initialization | ( | ) | (mparams.magic != 0 || init_mparams()) |
Definition at line 2488 of file malloc.c.h.
Referenced by change_mparam(), dlmalloc(), dlmalloc_trim(), dlpvalloc(), dlvalloc(), ialloc(), InitPool(), internal_mallinfo(), internal_malloc_stats(), sys_alloc(), and sys_trim().
| #define EXTERN_BIT (8U) |
Definition at line 1594 of file malloc.c.h.
| #define FENCEPOST_HEAD (INUSE_BITS|SIZE_T_SIZE) |
Definition at line 2120 of file malloc.c.h.
Referenced by add_segment(), internal_mallinfo(), internal_malloc_stats(), mmap_alloc(), mmap_resize(), and nedgetvalue().
| #define FLAG4_BIT (SIZE_T_FOUR) |
Definition at line 2115 of file malloc.c.h.
| #define FLAG_BITS (PINUSE_BIT|CINUSE_BIT|FLAG4_BIT) |
Definition at line 2117 of file malloc.c.h.
| #define fm gm |
Referenced by dlfree(), nedgetvalue(), and threadcache_free().
| #define FOOTERS 0 |
Definition at line 554 of file malloc.c.h.
| #define FOUR_SIZE_T_SIZES (SIZE_T_SIZE<<2) |
| #define get_foot | ( | p, | |||
| s | ) | (((mchunkptr)((char*)(p) + (s)))->prev_foot) |
Definition at line 2142 of file malloc.c.h.
| #define gm (&_gm_) |
Definition at line 2494 of file malloc.c.h.
Referenced by dlindependent_calloc(), dlindependent_comalloc(), dlmallinfo(), dlmalloc(), dlmalloc_footprint(), dlmalloc_max_footprint(), dlmalloc_trim(), dlmemalign(), dlrealloc(), and init_mparams().
| #define granularity_align | ( | S | ) |
Value:
(((S) + (mparams.granularity - SIZE_T_ONE))\ & ~(mparams.granularity - SIZE_T_ONE))
Definition at line 2526 of file malloc.c.h.
Referenced by sys_alloc().
| #define HALF_MAX_SIZE_T (MAX_SIZE_T / 2U) |
| #define HAVE_MMAP 1 |
| #define HAVE_MORECORE 1 |
| #define HAVE_MREMAP 0 |
Definition at line 588 of file malloc.c.h.
| #define idx2bit | ( | i | ) | ((binmap_t)(1) << (i)) |
| #define INITIAL_LOCK | ( | l | ) |
| #define INSECURE 0 |
Definition at line 576 of file malloc.c.h.
| #define insert_chunk | ( | M, | |||
| P, | |||||
| S | ) |
Value:
if (is_small(S)) insert_small_chunk(M, P, S)\ else { tchunkptr TP = (tchunkptr)(P); insert_large_chunk(M, TP, S); }
Definition at line 3626 of file malloc.c.h.
Referenced by add_segment(), prepend_alloc(), and tmalloc_large().
| #define insert_large_chunk | ( | M, | |||
| X, | |||||
| S | ) |
| #define insert_small_chunk | ( | M, | |||
| P, | |||||
| S | ) |
Value:
{\
bindex_t I = small_index(S);\
mchunkptr B = smallbin_at(M, I);\
mchunkptr F = B;\
assert(S >= MIN_CHUNK_SIZE);\
if (!smallmap_is_marked(M, I))\
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;\
}
Definition at line 3412 of file malloc.c.h.
Referenced by dlfree().
| #define internal_free | ( | m, | |||
| mem | ) | dlfree(mem) |
Definition at line 3648 of file malloc.c.h.
Referenced by internal_memalign(), and internal_realloc().
| #define internal_malloc | ( | m, | |||
| b | ) | dlmalloc(b) |
Definition at line 3647 of file malloc.c.h.
Referenced by ialloc(), internal_memalign(), and internal_realloc().
| #define INUSE_BITS (PINUSE_BIT|CINUSE_BIT) |
| #define is_aligned | ( | A | ) | (((size_t)((A)) & (CHUNK_ALIGN_MASK)) == 0) |
Definition at line 1438 of file malloc.c.h.
Referenced by add_segment(), mmap_alloc(), and nedgetvalue().
| #define is_extern_segment | ( | S | ) | ((S)->sflags & EXTERN_BIT) |
Definition at line 2342 of file malloc.c.h.
Referenced by release_unused_segments(), sys_alloc(), and sys_trim().
| #define is_global | ( | M | ) | ((M) == &_gm_) |
| #define is_granularity_aligned | ( | S | ) | (((size_t)(S) & (mparams.granularity - SIZE_T_ONE)) == 0) |
Definition at line 2543 of file malloc.c.h.
| #define is_initialized | ( | M | ) | ((M)->top != 0) |
Definition at line 2499 of file malloc.c.h.
Referenced by internal_mallinfo(), internal_malloc_stats(), sys_alloc(), and sys_trim().
| #define is_mmapped | ( | p | ) | (!((p)->head & PINUSE_BIT) && ((p)->prev_foot & IS_MMAPPED_BIT)) |
Definition at line 2153 of file malloc.c.h.
Referenced by ialloc(), internal_memalign(), internal_realloc(), and nedgetvalue().
| #define IS_MMAPPED_BIT (SIZE_T_ONE) |
Define CALL_MMAP/CALL_MUNMAP/CALL_DIRECT_MMAP
Definition at line 1547 of file malloc.c.h.
Referenced by dlfree(), mmap_alloc(), mmap_resize(), and sys_alloc().
| #define is_mmapped_segment | ( | S | ) | ((S)->sflags & IS_MMAPPED_BIT) |
Definition at line 2341 of file malloc.c.h.
Referenced by release_unused_segments(), and sys_trim().
| #define is_page_aligned | ( | S | ) | (((size_t)(S) & (mparams.page_size - SIZE_T_ONE)) == 0) |
| #define is_small | ( | s | ) | (((s) >> SMALLBIN_SHIFT) < NSMALLBINS) |
| #define least_bit | ( | x | ) | ((x) & -(x)) |
Definition at line 2781 of file malloc.c.h.
Referenced by dlmalloc(), tmalloc_large(), and tmalloc_small().
| #define left_bits | ( | x | ) | ((x<<1) | -(x<<1)) |
| #define leftmost_child | ( | t | ) | ((t)->child[0] != 0? (t)->child[0] : (t)->child[1]) |
| #define leftshift_for_tree_index | ( | i | ) |
Value:
((i == NTREEBINS-1)? 0 : \ ((SIZE_T_BITSIZE-SIZE_T_ONE) - (((i) >> 1) + TREEBIN_SHIFT - 2)))
Definition at line 2756 of file malloc.c.h.
Referenced by tmalloc_large().
| #define M_GRANULARITY (-2) |
| #define M_MMAP_THRESHOLD (-3) |
| #define M_TRIM_THRESHOLD (-1) |
| #define MALLINFO_FIELD_TYPE size_t |
Definition at line 647 of file malloc.c.h.
| #define MALLOC_ALIGNMENT ((size_t)8U) |
| #define MALLOC_FAILURE_ACTION errno = ENOMEM; |
Definition at line 592 of file malloc.c.h.
Referenced by internal_memalign(), internal_realloc(), and sys_alloc().
| #define malloc_getpagesize ((size_t)4096U) |
| #define mark_inuse_foot | ( | M, | |||
| p, | |||||
| s | ) |
| #define mark_smallmap | ( | M, | |||
| i | ) | ((M)->smallmap |= idx2bit(i)) |
Definition at line 2772 of file malloc.c.h.
| #define mark_treemap | ( | M, | |||
| i | ) | ((M)->treemap |= idx2bit(i)) |
Definition at line 2776 of file malloc.c.h.
| #define MAX_RELEASE_CHECK_RATE 4095 |
Definition at line 632 of file malloc.c.h.
Referenced by release_unused_segments(), and sys_alloc().
| #define MAX_REQUEST ((-MIN_CHUNK_SIZE) << 2) |
Definition at line 2089 of file malloc.c.h.
Referenced by dlmalloc(), internal_memalign(), internal_realloc(), and sys_trim().
| #define MAX_SIZE_T (~(size_t)0) |
Definition at line 536 of file malloc.c.h.
Referenced by change_mparam(), dlcalloc(), dlmalloc(), init_mparams(), and sys_trim().
| #define MAX_SMALL_REQUEST (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD) |
| #define MAX_SMALL_SIZE (MIN_LARGE_SIZE - SIZE_T_ONE) |
Definition at line 2438 of file malloc.c.h.
| #define MCHUNK_SIZE (sizeof(mchunk)) |
| #define mem2chunk | ( | mem | ) | ((mchunkptr)((char*)(mem) - TWO_SIZE_T_SIZES)) |
Definition at line 2084 of file malloc.c.h.
Referenced by dlcalloc(), dlfree(), dlmalloc_usable_size(), dlrealloc(), ialloc(), internal_memalign(), internal_realloc(), nedblksize(), nedgetvalue(), sys_alloc(), and threadcache_free().
| #define MFAIL ((void*)(MAX_SIZE_T)) |
| #define MIN_CHUNK_SIZE ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) |
Definition at line 2079 of file malloc.c.h.
Referenced by add_segment(), dlmalloc(), init_mparams(), internal_memalign(), internal_realloc(), prepend_alloc(), tmalloc_large(), and tmalloc_small().
| #define MIN_LARGE_SIZE (SIZE_T_ONE << TREEBIN_SHIFT) |
Definition at line 2437 of file malloc.c.h.
| #define MIN_REQUEST (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE) |
| #define MIN_SMALL_INDEX (small_index(MIN_CHUNK_SIZE)) |
Definition at line 2680 of file malloc.c.h.
| #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)))
Definition at line 2761 of file malloc.c.h.
| #define mmap_align | ( | S | ) | page_align(S) |
| #define MMAP_CHUNK_OVERHEAD (TWO_SIZE_T_SIZES) |
Definition at line 2074 of file malloc.c.h.
| #define MMAP_CLEARS 1 |
Definition at line 582 of file malloc.c.h.
| #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))
Definition at line 1476 of file malloc.c.h.
| #define MMAP_FLAGS (MAP_PRIVATE) |
Definition at line 1474 of file malloc.c.h.
| #define MMAP_FOOT_PAD (FOUR_SIZE_T_SIZES) |
Definition at line 2076 of file malloc.c.h.
Referenced by dlfree(), mmap_alloc(), and mmap_resize().
| #define MMAP_PROT (PROT_READ|PROT_WRITE) |
Definition at line 1462 of file malloc.c.h.
| #define MORECORE_CONTIGUOUS 1 |
| #define MORECORE_DEFAULT sbrk |
Definition at line 604 of file malloc.c.h.
| #define MSPACES 0 |
Definition at line 547 of file malloc.c.h.
| #define MUNMAP_DEFAULT | ( | a, | |||
| s | ) | munmap((a), (s)) |
Definition at line 1461 of file malloc.c.h.
| #define next_chunk | ( | p | ) | ((mchunkptr)( ((char*)(p)) + ((p)->head & ~FLAG_BITS))) |
Definition at line 2135 of file malloc.c.h.
Referenced by internal_mallinfo(), internal_malloc_stats(), nedgetvalue(), and sys_alloc().
| #define next_pinuse | ( | p | ) | ((next_chunk(p)->head) & PINUSE_BIT) |
| #define NO_MALLINFO 0 |
Definition at line 644 of file malloc.c.h.
| #define NO_SEGMENT_TRAVERSAL 0 |
Definition at line 650 of file malloc.c.h.
Referenced by release_unused_segments(), and sys_alloc().
| #define NOINLINE |
Definition at line 730 of file malloc.c.h.
| #define NSMALLBINS (32U) |
Definition at line 2432 of file malloc.c.h.
| #define NTREEBINS (32U) |
Definition at line 2433 of file malloc.c.h.
| #define ok_address | ( | M, | |||
| a | ) | ((char*)(a) >= (M)->least_addr) |
Definition at line 2863 of file malloc.c.h.
Referenced by dlfree(), internal_realloc(), nedgetvalue(), tmalloc_large(), and tmalloc_small().
| #define ok_cinuse | ( | p | ) | cinuse(p) |
| #define ok_magic | ( | M | ) | (1) |
Definition at line 2882 of file malloc.c.h.
Referenced by dlfree(), dlrealloc(), nedgetvalue(), and threadcache_free().
| #define ok_next | ( | p, | |||
| n | ) | ((char*)(p) < (char*)(n)) |
Definition at line 2865 of file malloc.c.h.
Referenced by dlfree(), internal_realloc(), tmalloc_large(), and tmalloc_small().
| #define ok_pinuse | ( | p | ) | pinuse(p) |
| #define ONLY_MSPACES 0 |
Definition at line 539 of file malloc.c.h.
| #define overhead_for | ( | p | ) | (is_mmapped(p)? MMAP_CHUNK_OVERHEAD : CHUNK_OVERHEAD) |
Definition at line 2157 of file malloc.c.h.
Referenced by dlmalloc_usable_size(), internal_realloc(), and nedblksize().
| #define pad_request | ( | req | ) | (((req) + CHUNK_OVERHEAD + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) |
| #define page_align | ( | S | ) | (((S) + (mparams.page_size - SIZE_T_ONE)) & ~(mparams.page_size - SIZE_T_ONE)) |
| #define pinuse | ( | p | ) | ((p)->head & PINUSE_BIT) |
Definition at line 2124 of file malloc.c.h.
Referenced by dlfree(), nedgetvalue(), and prepend_alloc().
| #define PINUSE_BIT (SIZE_T_ONE) |
Definition at line 2113 of file malloc.c.h.
Referenced by dlfree(), dlmalloc(), init_top(), internal_realloc(), prepend_alloc(), and sys_alloc().
| #define POSTACTION | ( | M | ) |
Definition at line 2606 of file malloc.c.h.
Referenced by dlfree(), dlmalloc(), dlmalloc_trim(), ialloc(), internal_mallinfo(), internal_malloc_stats(), internal_memalign(), and internal_realloc().
| #define PREACTION | ( | M | ) | (0) |
Definition at line 2602 of file malloc.c.h.
Referenced by dlfree(), dlmalloc(), dlmalloc_trim(), ialloc(), internal_mallinfo(), internal_malloc_stats(), internal_memalign(), and internal_realloc().
| #define prev_chunk | ( | p | ) | ((mchunkptr)( ((char*)(p)) - ((p)->prev_foot) )) |
| #define PROCEED_ON_ERROR 0 |
Definition at line 563 of file malloc.c.h.
| #define RELEASE_MALLOC_GLOBAL_LOCK | ( | ) |
Definition at line 1908 of file malloc.c.h.
Referenced by init_mparams(), InitPool(), sys_alloc(), and sys_trim().
| #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;\
}
Definition at line 3471 of file malloc.c.h.
Referenced by dlmalloc(), and tmalloc_small().
| #define request2size | ( | req | ) | (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req)) |
Definition at line 2097 of file malloc.c.h.
Referenced by ialloc(), internal_memalign(), and internal_realloc().
| #define RTCHECK | ( | e | ) | (e) |
Definition at line 2891 of file malloc.c.h.
Referenced by dlfree(), internal_realloc(), tmalloc_large(), and tmalloc_small().
| #define same_or_left_bits | ( | x | ) | ((x) | -(x)) |
Definition at line 2787 of file malloc.c.h.
| #define segment_holds | ( | S, | |||
| A | ) | ((char*)(A) >= S->base && (char*)(A) < S->base + S->size) |
Definition at line 2547 of file malloc.c.h.
Referenced by internal_mallinfo(), internal_malloc_stats(), release_unused_segments(), and sys_alloc().
| #define set_foot | ( | p, | |||
| s | ) | (((mchunkptr)((char*)(p) + (s)))->prev_foot = (s)) |
Definition at line 2143 of file malloc.c.h.
| #define set_free_with_pinuse | ( | p, | |||
| s, | |||||
| n | ) | (clear_pinuse(n), set_size_and_pinuse_of_free_chunk(p, s)) |
Definition at line 2150 of file malloc.c.h.
Referenced by add_segment(), dlfree(), and prepend_alloc().
| #define set_inuse | ( | M, | |||
| p, | |||||
| s | ) |
Value:
((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\ ((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT)
Definition at line 2904 of file malloc.c.h.
Referenced by internal_memalign(), and internal_realloc().
| #define set_inuse_and_pinuse | ( | M, | |||
| p, | |||||
| s | ) |
Value:
((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\ ((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT)
Definition at line 2909 of file malloc.c.h.
Referenced by dlmalloc(), tmalloc_large(), and tmalloc_small().
| #define set_lock | ( | M, | |||
| L | ) |
Value:
((M)->mflags = (L)?\ ((M)->mflags | USE_LOCK_BIT) :\ ((M)->mflags & ~USE_LOCK_BIT))
Definition at line 2516 of file malloc.c.h.
| #define set_size_and_pinuse_of_free_chunk | ( | p, | |||
| s | ) | ((p)->head = (s|PINUSE_BIT), set_foot(p, s)) |
Definition at line 2146 of file malloc.c.h.
Referenced by dlfree(), dlmalloc(), prepend_alloc(), tmalloc_large(), and tmalloc_small().
| #define set_size_and_pinuse_of_inuse_chunk | ( | M, | |||
| p, | |||||
| s | ) | ((p)->head = (s|PINUSE_BIT|CINUSE_BIT)) |
Definition at line 2914 of file malloc.c.h.
Referenced by add_segment(), dlmalloc(), ialloc(), prepend_alloc(), sys_alloc(), tmalloc_large(), and tmalloc_small().
| #define should_trim | ( | M, | |||
| s | ) | ((s) > (M)->trim_check) |
| #define SIX_SIZE_T_SIZES (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES) |
| #define SIZE_T_BITSIZE (sizeof(size_t) << 3) |
| #define SIZE_T_FOUR ((size_t)4) |
Definition at line 1428 of file malloc.c.h.
| #define SIZE_T_ONE ((size_t)1) |
Definition at line 1426 of file malloc.c.h.
Referenced by dlpvalloc(), init_mparams(), internal_mallinfo(), internal_memalign(), sys_trim(), and tmalloc_large().
| #define SIZE_T_SIZE (sizeof(size_t)) |
Definition at line 1420 of file malloc.c.h.
Referenced by add_segment(), dlmalloc(), ialloc(), mmap_alloc(), and mmap_resize().
| #define SIZE_T_TWO ((size_t)2) |
Definition at line 1427 of file malloc.c.h.
| #define SIZE_T_ZERO ((size_t)0) |
Definition at line 1425 of file malloc.c.h.
| #define small_index | ( | s | ) | ((s) >> SMALLBIN_SHIFT) |
| #define small_index2size | ( | i | ) | ((i) << SMALLBIN_SHIFT) |
| #define smallbin_at | ( | M, | |||
| i | ) | ((sbinptr)((char*)&((M)->smallbins[(i)<<1]))) |
| #define SMALLBIN_SHIFT (3U) |
Definition at line 2434 of file malloc.c.h.
| #define SMALLBIN_WIDTH (SIZE_T_ONE << SMALLBIN_SHIFT) |
Definition at line 2435 of file malloc.c.h.
| #define smallmap_is_marked | ( | M, | |||
| i | ) | ((M)->smallmap & idx2bit(i)) |
Definition at line 2774 of file malloc.c.h.
| #define STRUCT_MALLINFO_DECLARED 1 |
Definition at line 695 of file malloc.c.h.
| #define SYS_ALLOC_PADDING (TOP_FOOT_SIZE + MALLOC_ALIGNMENT) |
| #define TOP_FOOT_SIZE (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE) |
Definition at line 2583 of file malloc.c.h.
Referenced by add_segment(), init_top(), internal_mallinfo(), internal_malloc_stats(), release_unused_segments(), sys_alloc(), and sys_trim().
| #define treebin_at | ( | M, | |||
| i | ) | (&((M)->treebins[i])) |
| #define TREEBIN_SHIFT (8U) |
Definition at line 2436 of file malloc.c.h.
| #define treemap_is_marked | ( | M, | |||
| i | ) | ((M)->treemap & idx2bit(i)) |
Definition at line 2778 of file malloc.c.h.
| #define TWO_SIZE_T_SIZES (SIZE_T_SIZE<<1) |
Definition at line 1429 of file malloc.c.h.
| #define unlink_chunk | ( | M, | |||
| P, | |||||
| S | ) |
Value:
if (is_small(S)) unlink_small_chunk(M, P, S)\ else { tchunkptr TP = (tchunkptr)(P); unlink_large_chunk(M, TP); }
Definition at line 3630 of file malloc.c.h.
Referenced by dlfree(), and prepend_alloc().
| #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);\
}\
}
Definition at line 3451 of file malloc.c.h.
Referenced by dlmalloc().
| #define unlink_large_chunk | ( | M, | |||
| X | ) |
Definition at line 3553 of file malloc.c.h.
Referenced by release_unused_segments(), tmalloc_large(), and tmalloc_small().
| #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);\
}\
}
Definition at line 3431 of file malloc.c.h.
| #define USAGE_ERROR_ACTION | ( | m, | |||
| p | ) | ABORT |
Definition at line 2637 of file malloc.c.h.
Referenced by dlfree(), dlrealloc(), internal_realloc(), and threadcache_free().
| #define USE_BUILTIN_FFS 0 |
Definition at line 638 of file malloc.c.h.
| #define USE_DEV_RANDOM 0 |
Definition at line 641 of file malloc.c.h.
| #define use_lock | ( | M | ) | ((M)->mflags & USE_LOCK_BIT) |
Definition at line 2505 of file malloc.c.h.
| #define USE_LOCK_BIT (0U) |
| #define USE_LOCKS 0 |
Definition at line 566 of file malloc.c.h.
| #define use_mmap | ( | M | ) | ((M)->mflags & USE_MMAP_BIT) |
| #define USE_MMAP_BIT (SIZE_T_ONE) |
| #define use_noncontiguous | ( | M | ) | ((M)->mflags & USE_NONCONTIGUOUS_BIT) |
| #define USE_NONCONTIGUOUS_BIT (4U) |
| #define USE_SPIN_LOCKS 0 |
Definition at line 572 of file malloc.c.h.
| typedef unsigned int bindex_t |
Definition at line 2059 of file malloc.c.h.
| typedef unsigned int binmap_t |
Definition at line 2060 of file malloc.c.h.
| typedef unsigned int flag_t |
Definition at line 2061 of file malloc.c.h.
| typedef struct malloc_chunk mchunk |
Definition at line 2056 of file malloc.c.h.
| typedef struct malloc_chunk* mchunkptr |
Definition at line 2057 of file malloc.c.h.
| typedef struct malloc_segment msegment |
Definition at line 2344 of file malloc.c.h.
| typedef struct malloc_segment* msegmentptr |
Definition at line 2345 of file malloc.c.h.
| typedef struct malloc_state* mstate |
Definition at line 2465 of file malloc.c.h.
| typedef struct malloc_chunk* sbinptr |
Definition at line 2058 of file malloc.c.h.
| typedef struct malloc_tree_chunk* tbinptr |
Definition at line 2272 of file malloc.c.h.
| typedef struct malloc_tree_chunk tchunk |
Definition at line 2270 of file malloc.c.h.
| typedef struct malloc_tree_chunk* tchunkptr |
Definition at line 2271 of file malloc.c.h.
Definition at line 3814 of file malloc.c.h.
References align_offset, assert, malloc_segment::base, check_top_chunk, chunk2mem, CHUNK_ALIGN_MASK, chunk_plus_offset, FENCEPOST_HEAD, FOUR_SIZE_T_SIZES, malloc_chunk::head, init_top(), insert_chunk, is_aligned, MIN_CHUNK_SIZE, malloc_segment::next, pad_request, malloc_state::seg, segment_holding(), set_free_with_pinuse, set_size_and_pinuse_of_inuse_chunk, malloc_segment::sflags, malloc_segment::size, SIZE_T_SIZE, malloc_state::top, and TOP_FOOT_SIZE.
Referenced by sys_alloc().
| static int change_mparam | ( | int | param_number, | |
| int | value | |||
| ) | [static] |
Definition at line 3036 of file malloc.c.h.
References ensure_initialization, malloc_params::granularity, M_GRANULARITY, M_MMAP_THRESHOLD, M_TRIM_THRESHOLD, MAX_SIZE_T, malloc_params::mmap_threshold, mparams, malloc_params::page_size, and malloc_params::trim_threshold.
Referenced by dlmallopt().
| void * dlcalloc | ( | size_t | n_elements, | |
| size_t | elem_size | |||
| ) |
Definition at line 4831 of file malloc.c.h.
References calloc_must_clear, dlmalloc, MAX_SIZE_T, and mem2chunk.
| void dlfree | ( | void * | mem | ) |
Definition at line 4721 of file malloc.c.h.
References CALL_MUNMAP, check_free_chunk, check_inuse_chunk, chunk_minus_offset, chunk_plus_offset, chunksize, cinuse, malloc_state::dv, malloc_state::dvsize, fm, malloc_state::footprint, malloc_chunk::head, insert_large_chunk, insert_small_chunk, INUSE_BITS, IS_MMAPPED_BIT, is_small, mem2chunk, MMAP_FOOT_PAD, ok_address, ok_cinuse, ok_magic, ok_next, ok_pinuse, pinuse, PINUSE_BIT, POSTACTION, PREACTION, malloc_chunk::prev_foot, malloc_state::release_checks, release_unused_segments(), RTCHECK, set_free_with_pinuse, set_size_and_pinuse_of_free_chunk, should_trim, sys_trim(), malloc_state::top, malloc_state::topsize, unlink_chunk, and USAGE_ERROR_ACTION.
| void** dlindependent_calloc | ( | size_t | n_elements, | |
| size_t | elem_size, | |||
| void * | chunks[] | |||
| ) |
| void** dlindependent_calloc | ( | size_t | , | |
| size_t | , | |||
| void ** | ||||
| ) |
| void** dlindependent_comalloc | ( | size_t | n_elements, | |
| size_t | sizes[], | |||
| void * | chunks[] | |||
| ) |
| void** dlindependent_comalloc | ( | size_t | , | |
| size_t * | , | |||
| void ** | ||||
| ) |
| struct mallinfo dlmallinfo | ( | void | ) | [read] |
| void * dlmalloc | ( | size_t | bytes | ) |
Definition at line 4585 of file malloc.c.h.
References assert, check_malloced_chunk, check_top_chunk, chunk2mem, chunk_plus_offset, chunksize, compute_bit2idx, ensure_initialization, malloc_chunk::fd, gm, malloc_chunk::head, idx2bit, least_bit, left_bits, MAX_REQUEST, MAX_SIZE_T, MAX_SMALL_REQUEST, MIN_CHUNK_SIZE, MIN_REQUEST, pad_request, PINUSE_BIT, POSTACTION, PREACTION, replace_dv, set_inuse_and_pinuse, set_size_and_pinuse_of_free_chunk, set_size_and_pinuse_of_inuse_chunk, SIZE_T_SIZE, small_index, small_index2size, smallbin_at, sys_alloc(), tmalloc_large(), tmalloc_small(), and unlink_first_small_chunk.
| size_t dlmalloc_footprint | ( | void | ) |
| size_t dlmalloc_max_footprint | ( | void | ) |
| void dlmalloc_stats | ( | void | ) |
| int dlmalloc_trim | ( | size_t | pad | ) |
Definition at line 4898 of file malloc.c.h.
References ensure_initialization, gm, POSTACTION, PREACTION, and sys_trim().
| size_t dlmalloc_usable_size | ( | void * | mem | ) |
Definition at line 4932 of file malloc.c.h.
References chunksize, cinuse, mem2chunk, and overhead_for.
| int dlmallopt | ( | int | param_number, | |
| int | value | |||
| ) |
| void * dlmemalign | ( | size_t | alignment, | |
| size_t | bytes | |||
| ) |
| void * dlpvalloc | ( | size_t | bytes | ) |
Definition at line 4891 of file malloc.c.h.
References dlmemalign, ensure_initialization, mparams, malloc_params::page_size, and SIZE_T_ONE.
| void * dlrealloc | ( | void * | oldmem, | |
| size_t | bytes | |||
| ) |
Definition at line 4846 of file malloc.c.h.
References dlfree, dlmalloc, gm, internal_realloc(), mem2chunk, ok_magic, and USAGE_ERROR_ACTION.
| void * dlvalloc | ( | size_t | bytes | ) |
Definition at line 4884 of file malloc.c.h.
References dlmemalign, ensure_initialization, mparams, and malloc_params::page_size.
| static int has_segment_link | ( | mstate | m, | |
| msegmentptr | ss | |||
| ) | [static] |
Definition at line 2562 of file malloc.c.h.
References malloc_segment::base, malloc_segment::next, malloc_state::seg, and malloc_segment::size.
Referenced by sys_trim().
| static void** ialloc | ( | mstate | m, | |
| size_t | n_elements, | |||
| size_t * | sizes, | |||
| int | opts, | |||
| void * | chunks[] | |||
| ) | [static] |
Definition at line 4453 of file malloc.c.h.
References assert, check_inuse_chunk, chunk2mem, CHUNK_OVERHEAD, chunk_plus_offset, chunksize, disable_mmap, enable_mmap, ensure_initialization, internal_malloc, is_mmapped, mem2chunk, POSTACTION, PREACTION, request2size, set_size_and_pinuse_of_inuse_chunk, SIZE_T_SIZE, and use_mmap.
Referenced by dlindependent_calloc(), and dlindependent_comalloc().
| static void init_bins | ( | mstate | m | ) | [static] |
Definition at line 3743 of file malloc.c.h.
References malloc_chunk::bk, malloc_chunk::fd, and smallbin_at.
Referenced by sys_alloc().
| static int init_mparams | ( | void | ) | [static] |
Definition at line 2946 of file malloc.c.h.
References ABORT, ACQUIRE_MALLOC_GLOBAL_LOCK, DEFAULT_GRANULARITY, malloc_params::default_mflags, DEFAULT_MMAP_THRESHOLD, DEFAULT_TRIM_THRESHOLD, gm, malloc_params::granularity, INITIAL_LOCK, malloc_state::magic, malloc_params::magic, MALLOC_ALIGNMENT, malloc_getpagesize, MAX_SIZE_T, MCHUNK_SIZE, MIN_CHUNK_SIZE, malloc_params::mmap_threshold, mparams, malloc_params::page_size, RELEASE_MALLOC_GLOBAL_LOCK, SIZE_T_ONE, malloc_params::trim_threshold, USE_LOCK_BIT, USE_MMAP_BIT, and USE_NONCONTIGUOUS_BIT.
Definition at line 3728 of file malloc.c.h.
References align_offset, chunk2mem, chunk_plus_offset, malloc_chunk::head, mparams, PINUSE_BIT, malloc_state::top, TOP_FOOT_SIZE, malloc_state::topsize, malloc_state::trim_check, and malloc_params::trim_threshold.
Referenced by add_segment(), sys_alloc(), and sys_trim().
Definition at line 3329 of file malloc.c.h.
References align_as_chunk, mallinfo::arena, malloc_segment::base, check_malloc_state, chunksize, cinuse, ensure_initialization, FENCEPOST_HEAD, malloc_state::footprint, mallinfo::fordblks, mallinfo::hblkhd, malloc_chunk::head, is_initialized, mallinfo::keepcost, malloc_state::max_footprint, malloc_segment::next, next_chunk, mallinfo::ordblks, POSTACTION, PREACTION, malloc_state::seg, segment_holds, SIZE_T_ONE, malloc_state::top, TOP_FOOT_SIZE, malloc_state::topsize, mallinfo::uordblks, and mallinfo::usmblks.
Referenced by dlmallinfo().
| static void internal_malloc_stats | ( | mstate | m | ) | [static] |
Definition at line 3369 of file malloc.c.h.
References align_as_chunk, malloc_segment::base, check_malloc_state, chunksize, cinuse, ensure_initialization, FENCEPOST_HEAD, malloc_state::footprint, malloc_chunk::head, is_initialized, malloc_state::max_footprint, malloc_segment::next, next_chunk, POSTACTION, PREACTION, malloc_state::seg, segment_holds, malloc_state::top, TOP_FOOT_SIZE, and malloc_state::topsize.
| static void* internal_memalign | ( | mstate | m, | |
| size_t | alignment, | |||
| size_t | bytes | |||
| ) | [static] |
Definition at line 4366 of file malloc.c.h.
References assert, check_inuse_chunk, chunk2mem, CHUNK_OVERHEAD, chunk_plus_offset, chunksize, CINUSE_BIT, malloc_chunk::head, internal_free, internal_malloc, is_mmapped, MALLOC_ALIGNMENT, MALLOC_FAILURE_ACTION, MAX_REQUEST, mem2chunk, MIN_CHUNK_SIZE, POSTACTION, PREACTION, malloc_chunk::prev_foot, request2size, set_inuse, and SIZE_T_ONE.
Referenced by dlmemalign().
| static void* internal_realloc | ( | mstate | m, | |
| void * | oldmem, | |||
| size_t | bytes | |||
| ) | [static] |
Definition at line 4295 of file malloc.c.h.
References check_inuse_chunk, chunk2mem, chunk_plus_offset, chunksize, malloc_chunk::head, internal_free, internal_malloc, is_mmapped, MALLOC_FAILURE_ACTION, MAX_REQUEST, mem2chunk, MIN_CHUNK_SIZE, mmap_resize(), ok_address, ok_cinuse, ok_next, ok_pinuse, overhead_for, PINUSE_BIT, POSTACTION, PREACTION, request2size, RTCHECK, set_inuse, malloc_state::top, malloc_state::topsize, and USAGE_ERROR_ACTION.
Referenced by dlrealloc().
| static void* mmap_alloc | ( | mstate | m, | |
| size_t | nb | |||
| ) | [static] |
Definition at line 3665 of file malloc.c.h.
References align_offset, assert, CALL_DIRECT_MMAP, check_mmapped_chunk, chunk2mem, CHUNK_ALIGN_MASK, chunk_plus_offset, CINUSE_BIT, CMFAIL, FENCEPOST_HEAD, malloc_state::footprint, is_aligned, IS_MMAPPED_BIT, malloc_state::least_addr, mark_inuse_foot, malloc_state::max_footprint, mmap_align, MMAP_FOOT_PAD, malloc_chunk::prev_foot, SIX_SIZE_T_SIZES, and SIZE_T_SIZE.
Referenced by sys_alloc().
Definition at line 3692 of file malloc.c.h.
References CALL_MREMAP, check_mmapped_chunk, CHUNK_ALIGN_MASK, chunk_plus_offset, chunksize, CINUSE_BIT, CMFAIL, FENCEPOST_HEAD, malloc_state::footprint, malloc_params::granularity, malloc_chunk::head, IS_MMAPPED_BIT, is_small, malloc_state::least_addr, mark_inuse_foot, malloc_state::max_footprint, mmap_align, MMAP_FOOT_PAD, mparams, malloc_chunk::prev_foot, SIX_SIZE_T_SIZES, and SIZE_T_SIZE.
Referenced by internal_realloc().
| static void* prepend_alloc | ( | mstate | m, | |
| char * | newbase, | |||
| char * | oldbase, | |||
| size_t | nb | |||
| ) | [static] |
Definition at line 3772 of file malloc.c.h.
References align_as_chunk, assert, check_free_chunk, check_malloced_chunk, check_top_chunk, chunk2mem, chunk_plus_offset, chunksize, cinuse, malloc_state::dv, malloc_state::dvsize, malloc_chunk::head, insert_chunk, MIN_CHUNK_SIZE, pinuse, PINUSE_BIT, set_free_with_pinuse, set_size_and_pinuse_of_free_chunk, set_size_and_pinuse_of_inuse_chunk, malloc_state::top, malloc_state::topsize, and unlink_chunk.
Referenced by sys_alloc().
| static size_t release_unused_segments | ( | mstate | m | ) | [static] |
Definition at line 4070 of file malloc.c.h.
References align_as_chunk, assert, malloc_segment::base, CALL_MUNMAP, chunksize, cinuse, malloc_state::dv, malloc_state::dvsize, malloc_state::footprint, insert_large_chunk, is_extern_segment, is_mmapped_segment, MAX_RELEASE_CHECK_RATE, malloc_segment::next, NO_SEGMENT_TRAVERSAL, malloc_state::release_checks, malloc_state::seg, segment_holds, malloc_segment::size, TOP_FOOT_SIZE, and unlink_large_chunk.
Referenced by dlfree(), and sys_trim().
| static msegmentptr segment_holding | ( | mstate | m, | |
| char * | addr | |||
| ) | [static] |
Definition at line 2551 of file malloc.c.h.
References malloc_segment::base, malloc_segment::next, malloc_state::seg, and malloc_segment::size.
Referenced by add_segment(), sys_alloc(), and sys_trim().
| static void* sys_alloc | ( | mstate | m, | |
| size_t | nb | |||
| ) | [static] |
Definition at line 3869 of file malloc.c.h.
References ACQUIRE_MALLOC_GLOBAL_LOCK, add_segment(), malloc_segment::base, CALL_MMAP, CALL_MORECORE, check_malloced_chunk, check_top_chunk, chunk2mem, chunk_plus_offset, CMFAIL, disable_contiguous, ensure_initialization, malloc_state::footprint, granularity_align, HALF_MAX_SIZE_T, HAVE_MMAP, HAVE_MORECORE, malloc_chunk::head, init_bins(), init_top(), is_extern_segment, is_global, is_initialized, IS_MMAPPED_BIT, is_page_aligned, malloc_state::least_addr, malloc_params::magic, malloc_state::magic, MALLOC_FAILURE_ACTION, malloc_state::max_footprint, MAX_RELEASE_CHECK_RATE, mem2chunk, mmap_alloc(), malloc_params::mmap_threshold, MORECORE_CONTIGUOUS, mparams, malloc_segment::next, next_chunk, NO_SEGMENT_TRAVERSAL, page_align, PINUSE_BIT, prepend_alloc(), malloc_state::release_checks, RELEASE_MALLOC_GLOBAL_LOCK, malloc_state::seg, segment_holding(), segment_holds, set_size_and_pinuse_of_inuse_chunk, malloc_segment::sflags, malloc_segment::size, SYS_ALLOC_PADDING, malloc_state::top, TOP_FOOT_SIZE, malloc_state::topsize, use_mmap, and use_noncontiguous.
Referenced by dlmalloc().
| static int sys_trim | ( | mstate | m, | |
| size_t | pad | |||
| ) | [static] |
Definition at line 4117 of file malloc.c.h.
References ACQUIRE_MALLOC_GLOBAL_LOCK, malloc_segment::base, CALL_MORECORE, CALL_MREMAP, CALL_MUNMAP, check_top_chunk, CMFAIL, ensure_initialization, malloc_state::footprint, malloc_params::granularity, HALF_MAX_SIZE_T, has_segment_link(), HAVE_MMAP, HAVE_MORECORE, init_top(), is_extern_segment, is_initialized, is_mmapped_segment, MAX_REQUEST, MAX_SIZE_T, MFAIL, mparams, RELEASE_MALLOC_GLOBAL_LOCK, release_unused_segments(), segment_holding(), malloc_segment::size, SIZE_T_ONE, malloc_state::top, TOP_FOOT_SIZE, malloc_state::topsize, and malloc_state::trim_check.
Referenced by dlfree(), and dlmalloc_trim().
| static void* tmalloc_large | ( | mstate | m, | |
| size_t | nb | |||
| ) | [static] |
Definition at line 4185 of file malloc.c.h.
References assert, malloc_tree_chunk::child, chunk2mem, chunk_plus_offset, chunksize, compute_bit2idx, compute_tree_index, CORRUPTION_ERROR_ACTION, malloc_state::dvsize, idx2bit, insert_chunk, least_bit, left_bits, leftmost_child, leftshift_for_tree_index, MIN_CHUNK_SIZE, ok_address, ok_next, RTCHECK, set_inuse_and_pinuse, set_size_and_pinuse_of_free_chunk, set_size_and_pinuse_of_inuse_chunk, SIZE_T_BITSIZE, SIZE_T_ONE, treebin_at, malloc_state::treemap, and unlink_large_chunk.
Referenced by dlmalloc().
| static void* tmalloc_small | ( | mstate | m, | |
| size_t | nb | |||
| ) | [static] |
Definition at line 4256 of file malloc.c.h.
References assert, chunk2mem, chunk_plus_offset, chunksize, compute_bit2idx, CORRUPTION_ERROR_ACTION, least_bit, leftmost_child, MIN_CHUNK_SIZE, ok_address, ok_next, replace_dv, RTCHECK, set_inuse_and_pinuse, set_size_and_pinuse_of_free_chunk, set_size_and_pinuse_of_inuse_chunk, treebin_at, malloc_state::treemap, and unlink_large_chunk.
Referenced by dlmalloc().
struct malloc_state _gm_ [static] |
Definition at line 2493 of file malloc.c.h.
int dev_zero_fd = -1 [static] |
Definition at line 1475 of file malloc.c.h.
struct malloc_params mparams [static] |
Definition at line 2485 of file malloc.c.h.
Referenced by change_mparam(), dlpvalloc(), dlvalloc(), init_mparams(), init_top(), mmap_resize(), sys_alloc(), and sys_trim().
1.5.6