Geant4
10.00.p03
|
#include <sys/types.h>
#include <iostream>
#include "tls.hh"
#include <stdio.h>
#include <errno.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/param.h>
Go to the source code of this file.
Classes | |
struct | mallinfo |
struct | malloc_chunk |
struct | malloc_tree_chunk |
struct | malloc_segment |
struct | malloc_state |
struct | malloc_params |
Macros | |
#define | MSPACES 1 |
#define | DLMALLOC_VERSION 20804 |
#define | SPIN_LOCKS_AVAILABLE 0 |
#define | MAX_SIZE_T (~(size_t)0) |
#define | ONLY_MSPACES 0 /* define to a value */ |
#define | MALLOC_ALIGNMENT ((size_t)8U) |
#define | FOOTERS 0 |
#define | ABORT abort() |
#define | ABORT_ON_ASSERT_FAILURE 1 |
#define | PROCEED_ON_ERROR 0 |
#define | USE_LOCKS 0 |
#define | USE_SPIN_LOCKS 0 |
#define | INSECURE 0 |
#define | HAVE_MMAP 1 |
#define | MMAP_CLEARS 1 |
#define | HAVE_MREMAP 0 |
#define | MALLOC_FAILURE_ACTION errno = ENOMEM; |
#define | HAVE_MORECORE 1 |
#define | MORECORE_DEFAULT sbrk |
#define | MORECORE_CONTIGUOUS 1 |
#define | DEFAULT_GRANULARITY (0) /* 0 means to compute in init_mparams */ |
#define | DEFAULT_TRIM_THRESHOLD ((size_t)2U * (size_t)1024U * (size_t)1024U) |
#define | DEFAULT_MMAP_THRESHOLD ((size_t)256U * (size_t)1024U) |
#define | MAX_RELEASE_CHECK_RATE 4095 |
#define | USE_BUILTIN_FFS 0 |
#define | USE_DEV_RANDOM 0 |
#define | NO_MALLINFO 0 |
#define | MALLINFO_FIELD_TYPE size_t |
#define | NO_SEGMENT_TRAVERSAL 0 |
#define | M_TRIM_THRESHOLD (-1) |
#define | M_GRANULARITY (-2) |
#define | M_MMAP_THRESHOLD (-3) |
#define | STRUCT_MALLINFO_DECLARED 1 |
#define | NOINLINE |
#define | FORCEINLINE |
#define | dlcalloc mycalloc |
#define | dlfree myfree |
#define | dlmalloc mymalloc |
#define | dlmemalign mymemalign |
#define | dlrealloc myrealloc |
#define | dlvalloc myvalloc |
#define | dlpvalloc mypvalloc |
#define | dlmallinfo mymallinfo |
#define | dlmallopt mymallopt |
#define | dlmalloc_trim mymalloc_trim |
#define | dlmalloc_stats mymalloc_stats |
#define | dlmalloc_usable_size mymalloc_usable_size |
#define | dlmalloc_footprint mymalloc_footprint |
#define | dlmalloc_max_footprint mymalloc_max_footprint |
#define | dlindependent_calloc myindependent_calloc |
#define | dlindependent_comalloc myindependent_comalloc |
#define | assert(x) |
#define | DEBUG 0 |
#define | malloc_getpagesize ((size_t)4096U) |
#define | SIZE_T_SIZE (sizeof(size_t)) |
#define | SIZE_T_BITSIZE (sizeof(size_t) << 3) |
#define | SIZE_T_ZERO ((size_t)0) |
#define | SIZE_T_ONE ((size_t)1) |
#define | SIZE_T_TWO ((size_t)2) |
#define | SIZE_T_FOUR ((size_t)4) |
#define | TWO_SIZE_T_SIZES (SIZE_T_SIZE<<1) |
#define | FOUR_SIZE_T_SIZES (SIZE_T_SIZE<<2) |
#define | SIX_SIZE_T_SIZES (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES) |
#define | HALF_MAX_SIZE_T (MAX_SIZE_T / 2U) |
#define | CHUNK_ALIGN_MASK (MALLOC_ALIGNMENT - SIZE_T_ONE) |
#define | is_aligned(A) (((size_t)((A)) & (CHUNK_ALIGN_MASK)) == 0) |
#define | align_offset(A) |
#define | MFAIL ((void*)(MAX_SIZE_T)) |
#define | CMFAIL ((char*)(MFAIL)) /* defined for convenience */ |
#define | MUNMAP_DEFAULT(a, s) munmap((a), (s)) |
#define | MMAP_PROT (PROT_READ|PROT_WRITE) |
#define | MMAP_FLAGS (MAP_PRIVATE) |
#define | MMAP_DEFAULT(s) |
#define | DIRECT_MMAP_DEFAULT(s) MMAP_DEFAULT(s) |
#define | CALL_MORECORE(S) MORECORE_DEFAULT(S) |
Define CALL_MORECORE. More... | |
#define | USE_MMAP_BIT (SIZE_T_ONE) |
Define CALL_MMAP/CALL_MUNMAP/CALL_DIRECT_MMAP. More... | |
#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 CALL_MREMAP. More... | |
#define | USE_NONCONTIGUOUS_BIT (4U) |
#define | EXTERN_BIT (8U) |
#define | USE_LOCK_BIT (0U) |
#define | INITIAL_LOCK(l) |
#define | ACQUIRE_MALLOC_GLOBAL_LOCK() |
#define | RELEASE_MALLOC_GLOBAL_LOCK() |
#define | MCHUNK_SIZE (sizeof(mchunk)) |
#define | CHUNK_OVERHEAD (SIZE_T_SIZE) |
#define | MMAP_CHUNK_OVERHEAD (TWO_SIZE_T_SIZES) |
#define | MMAP_FOOT_PAD (FOUR_SIZE_T_SIZES) |
#define | MIN_CHUNK_SIZE ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) |
#define | chunk2mem(p) ((void*)((char*)(p) + TWO_SIZE_T_SIZES)) |
#define | mem2chunk(mem) ((mchunkptr)((char*)(mem) - TWO_SIZE_T_SIZES)) |
#define | align_as_chunk(A) (mchunkptr)((A) + align_offset(chunk2mem(A))) |
#define | MAX_REQUEST ((-MIN_CHUNK_SIZE) << 2) |
#define | MIN_REQUEST (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE) |
#define | pad_request(req) (((req) + CHUNK_OVERHEAD + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) |
#define | request2size(req) (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req)) |
#define | PINUSE_BIT (SIZE_T_ONE) |
#define | CINUSE_BIT (SIZE_T_TWO) |
#define | FLAG4_BIT (SIZE_T_FOUR) |
#define | INUSE_BITS (PINUSE_BIT|CINUSE_BIT) |
#define | FLAG_BITS (PINUSE_BIT|CINUSE_BIT|FLAG4_BIT) |
#define | FENCEPOST_HEAD (INUSE_BITS|SIZE_T_SIZE) |
#define | cinuse(p) ((p)->head & CINUSE_BIT) |
#define | pinuse(p) ((p)->head & PINUSE_BIT) |
#define | is_inuse(p) (((p)->head & INUSE_BITS) != PINUSE_BIT) |
#define | is_mmapped(p) (((p)->head & INUSE_BITS) == 0) |
#define | chunksize(p) ((p)->head & ~(FLAG_BITS)) |
#define | clear_pinuse(p) ((p)->head &= ~PINUSE_BIT) |
#define | chunk_plus_offset(p, s) ((mchunkptr)(((char*)(p)) + (s))) |
#define | chunk_minus_offset(p, s) ((mchunkptr)(((char*)(p)) - (s))) |
#define | next_chunk(p) ((mchunkptr)( ((char*)(p)) + ((p)->head & ~FLAG_BITS))) |
#define | prev_chunk(p) ((mchunkptr)( ((char*)(p)) - ((p)->prev_foot) )) |
#define | next_pinuse(p) ((next_chunk(p)->head) & PINUSE_BIT) |
#define | get_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_foot) |
#define | set_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_foot = (s)) |
#define | set_size_and_pinuse_of_free_chunk(p, s) ((p)->head = (s|PINUSE_BIT), set_foot(p, s)) |
#define | set_free_with_pinuse(p, s, n) (clear_pinuse(n), set_size_and_pinuse_of_free_chunk(p, s)) |
#define | overhead_for(p) (is_mmapped(p)? MMAP_CHUNK_OVERHEAD : CHUNK_OVERHEAD) |
#define | calloc_must_clear(p) (!is_mmapped(p)) |
#define | leftmost_child(t) ((t)->child[0] != 0? (t)->child[0] : (t)->child[1]) |
#define | is_mmapped_segment(S) ((S)->sflags & USE_MMAP_BIT) |
#define | is_extern_segment(S) ((S)->sflags & EXTERN_BIT) |
#define | NSMALLBINS (32U) |
#define | NTREEBINS (32U) |
#define | SMALLBIN_SHIFT (3U) |
#define | SMALLBIN_WIDTH (SIZE_T_ONE << SMALLBIN_SHIFT) |
#define | TREEBIN_SHIFT (8U) |
#define | MIN_LARGE_SIZE (SIZE_T_ONE << TREEBIN_SHIFT) |
#define | MAX_SMALL_SIZE (MIN_LARGE_SIZE - SIZE_T_ONE) |
#define | MAX_SMALL_REQUEST (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD) |
#define | ensure_initialization() (void)(mparams.magic != 0 || init_mparams()) |
#define | gm (&_gm_) |
#define | is_global(M) ((M) == &_gm_) |
#define | is_initialized(M) ((M)->top != 0) |
#define | use_lock(M) ((M)->mflags & USE_LOCK_BIT) |
#define | enable_lock(M) ((M)->mflags |= USE_LOCK_BIT) |
#define | disable_lock(M) ((M)->mflags &= ~USE_LOCK_BIT) |
#define | use_mmap(M) ((M)->mflags & USE_MMAP_BIT) |
#define | enable_mmap(M) ((M)->mflags |= USE_MMAP_BIT) |
#define | disable_mmap(M) ((M)->mflags &= ~USE_MMAP_BIT) |
#define | use_noncontiguous(M) ((M)->mflags & USE_NONCONTIGUOUS_BIT) |
#define | disable_contiguous(M) ((M)->mflags |= USE_NONCONTIGUOUS_BIT) |
#define | set_lock(M, L) |
#define | page_align(S) (((S) + (mparams.page_size - SIZE_T_ONE)) & ~(mparams.page_size - SIZE_T_ONE)) |
#define | granularity_align(S) |
#define | mmap_align(S) page_align(S) |
#define | SYS_ALLOC_PADDING (TOP_FOOT_SIZE + MALLOC_ALIGNMENT) |
#define | is_page_aligned(S) (((size_t)(S) & (mparams.page_size - SIZE_T_ONE)) == 0) |
#define | is_granularity_aligned(S) (((size_t)(S) & (mparams.granularity - SIZE_T_ONE)) == 0) |
#define | segment_holds(S, A) ((char*)(A) >= S->base && (char*)(A) < S->base + S->size) |
#define | should_trim(M, s) ((s) > (M)->trim_check) |
#define | TOP_FOOT_SIZE (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE) |
#define | PREACTION(M) (0) |
#define | POSTACTION(M) |
#define | CORRUPTION_ERROR_ACTION(m) ABORT |
#define | USAGE_ERROR_ACTION(m, p) ABORT |
#define | check_free_chunk(M, P) |
#define | check_inuse_chunk(M, P) |
#define | check_malloced_chunk(M, P, N) |
#define | check_mmapped_chunk(M, P) |
#define | check_malloc_state(M) |
#define | check_top_chunk(M, P) |
#define | is_small(s) (((s) >> SMALLBIN_SHIFT) < NSMALLBINS) |
#define | small_index(s) ((s) >> SMALLBIN_SHIFT) |
#define | small_index2size(i) ((i) << SMALLBIN_SHIFT) |
#define | MIN_SMALL_INDEX (small_index(MIN_CHUNK_SIZE)) |
#define | smallbin_at(M, i) ((sbinptr)((char*)&((M)->smallbins[(i)<<1]))) |
#define | treebin_at(M, i) (&((M)->treebins[i])) |
#define | compute_tree_index(S, I) |
#define | bit_for_tree_index(i) (i == NTREEBINS-1)? (SIZE_T_BITSIZE-1) : (((i) >> 1) + TREEBIN_SHIFT - 2) |
#define | leftshift_for_tree_index(i) |
#define | minsize_for_tree_index(i) |
#define | idx2bit(i) ((binmap_t)(1) << (i)) |
#define | mark_smallmap(M, i) ((M)->smallmap |= idx2bit(i)) |
#define | clear_smallmap(M, i) ((M)->smallmap &= ~idx2bit(i)) |
#define | smallmap_is_marked(M, i) ((M)->smallmap & idx2bit(i)) |
#define | mark_treemap(M, i) ((M)->treemap |= idx2bit(i)) |
#define | clear_treemap(M, i) ((M)->treemap &= ~idx2bit(i)) |
#define | treemap_is_marked(M, i) ((M)->treemap & idx2bit(i)) |
#define | least_bit(x) ((x) & -(x)) |
#define | left_bits(x) ((x<<1) | -(x<<1)) |
#define | same_or_left_bits(x) ((x) | -(x)) |
#define | compute_bit2idx(X, I) |
#define | ok_address(M, a) ((char*)(a) >= (M)->least_addr) |
#define | ok_next(p, n) ((char*)(p) < (char*)(n)) |
#define | ok_inuse(p) is_inuse(p) |
#define | ok_pinuse(p) pinuse(p) |
#define | ok_magic(M) (1) |
#define | RTCHECK(e) (e) |
#define | mark_inuse_foot(M, p, s) |
#define | set_inuse(M, p, s) |
#define | set_inuse_and_pinuse(M, p, s) |
#define | set_size_and_pinuse_of_inuse_chunk(M, p, s) ((p)->head = (s|PINUSE_BIT|CINUSE_BIT)) |
#define | insert_small_chunk(M, P, S) |
#define | unlink_small_chunk(M, P, S) |
#define | unlink_first_small_chunk(M, B, P, I) |
#define | replace_dv(M, P, S) |
#define | insert_large_chunk(M, X, S) |
#define | unlink_large_chunk(M, X) |
#define | insert_chunk(M, P, S) |
#define | unlink_chunk(M, P, S) |
#define | internal_malloc(m, b) (m == gm)? dlmalloc(b) : mspace_malloc(m, b) |
#define | internal_free(m, mem) if (m == gm) dlfree(mem); else mspace_free(m,mem); |
#define | fm gm |
Typedefs | |
typedef void * | mspace |
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 *) |
mspace | create_mspace (size_t capacity, int locked) |
size_t | destroy_mspace (mspace msp) |
mspace | create_mspace_with_base (void *base, size_t capacity, int locked) |
int | mspace_track_large_chunks (mspace msp, int enable) |
void * | mspace_malloc (mspace msp, size_t bytes) |
void | mspace_free (mspace msp, void *mem) |
void * | mspace_realloc (mspace msp, void *mem, size_t newsize) |
void * | mspace_calloc (mspace msp, size_t n_elements, size_t elem_size) |
void * | mspace_memalign (mspace msp, size_t alignment, size_t bytes) |
void ** | mspace_independent_calloc (mspace msp, size_t n_elements, size_t elem_size, void *chunks[]) |
void ** | mspace_independent_comalloc (mspace msp, size_t n_elements, size_t sizes[], void *chunks[]) |
size_t | mspace_footprint (mspace msp) |
size_t | mspace_max_footprint (mspace msp) |
struct mallinfo | mspace_mallinfo (mspace msp) |
size_t | mspace_usable_size (void *mem) |
void | mspace_malloc_stats (mspace msp) |
int | mspace_trim (mspace msp, size_t pad) |
int | mspace_mallopt (int, int) |
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[]) |
static mstate | init_user_mstate (char *tbase, size_t tsize) |
Variables | |
static G4ThreadLocal int | dev_zero_fd = -1 |
static G4ThreadLocal struct malloc_params | mparams |
static G4ThreadLocal struct malloc_state | _gm_ |
#define ABORT abort() |
Definition at line 566 of file mymalloc.cc.
Referenced by init_mparams().
#define ABORT_ON_ASSERT_FAILURE 1 |
Definition at line 569 of file mymalloc.cc.
#define ACQUIRE_MALLOC_GLOBAL_LOCK | ( | ) |
Definition at line 1915 of file mymalloc.cc.
Referenced by init_mparams(), sys_alloc(), and sys_trim().
Definition at line 2094 of file mymalloc.cc.
Referenced by init_user_mstate(), internal_mallinfo(), internal_malloc_stats(), prepend_alloc(), and release_unused_segments().
#define align_offset | ( | A | ) |
Definition at line 1462 of file mymalloc.cc.
Referenced by add_segment(), init_top(), and mmap_alloc().
#define assert | ( | x | ) |
Definition at line 1309 of file mymalloc.cc.
Referenced by add_segment(), G4VoxelLimits::AddLimit(), addThread(), G4VUserDetectorConstruction::CloneF(), G4VUserDetectorConstruction::CloneSD(), Run::ComputeStatistics(), G4OpenInventorXtExaminerViewer::constructor(), G4WorkerRunManager::ConstructScoringWorlds(), G4VisManager::CurrentTrajDrawModel(), G4MagneticFieldModel::DescribeYourselfTo(), G4VisManager::DispatchToModel(), G4OpenInventorXtExaminerViewer::distanceToTrajectory(), dlmalloc(), G4TrajectoryDrawByOriginVolume::Draw(), G4TrajectoryDrawByAttribute::Draw(), CLibSymbolInfo::DumpSymbols(), ElectronRunAction::EndOfRunAction(), G4TrajectoryOriginVolumeFilter::Evaluate(), tbbTask::execute(), FinishDetection(), finishtracer(), G4AtomicShells::GetBindingEnergy(), G4VTrajectoryModel::GetContext(), G4HepRepSceneHandler::getGeometryOrEventInstance(), G4SandiaTable::GetIonizationPot(), G4SandiaTable::GetNbOfIntervals(), G4AttFilterUtils::GetNewFilter(), G4AtomicShells::GetNumberOfElectrons(), G4AtomicShells::GetNumberOfShells(), G4SandiaTable::GetSandiaCofForMaterial(), G4SandiaTable::GetSandiaCofForMaterialPAI(), G4SandiaTable::GetSandiaCofPerAtom(), G4SandiaTable::GetSandiaMatTable(), G4SandiaTable::GetSandiaMatTablePAI(), G4SandiaTable::GetSandiaPerAtom(), G4OpenInventorXtExaminerViewer::getSuperimpositionNode(), G4AtomicShells::GetTotalBindingEnergy(), G4SandiaTable::GetZtoA(), handler0(), handler1(), ialloc(), insertAddress(), internal_memalign(), mmap_alloc(), mspace_malloc(), prepend_alloc(), ElectronRun::RecordEvent(), G4VisListManager< T >::Register(), G4ITModelHandler::RegisterModel(), release_unused_segments(), G4VoxelSafety::SafetyForVoxelHeader(), G4ITModelManager::SetModel(), G4ITModelHandler::SetModel(), G4VisCommandListManagerList< Manager >::SetNewValue(), G4VisCommandModelCreate< Factory >::SetNewValue(), G4VisCommandListManagerSelect< Manager >::SetNewValue(), G4VisCommandManagerMode< Manager >::SetNewValue(), G3Division::SetRangeAndAxis(), G4WorkerRunManager::SetupDefaultRNGEngine(), StartDetection(), tmalloc_large(), tmalloc_small(), G4OpenInventorXtExaminerViewer::updateSpeedIndicator(), and XML_GetParsingStatus().
#define bit_for_tree_index | ( | i | ) | (i == NTREEBINS-1)? (SIZE_T_BITSIZE-1) : (((i) >> 1) + TREEBIN_SHIFT - 2) |
Definition at line 2757 of file mymalloc.cc.
#define CALL_DIRECT_MMAP | ( | s | ) | DIRECT_MMAP_DEFAULT(s) |
Definition at line 1583 of file mymalloc.cc.
Referenced by mmap_alloc().
#define CALL_MMAP | ( | s | ) | MMAP_DEFAULT(s) |
Definition at line 1573 of file mymalloc.cc.
Referenced by create_mspace(), and sys_alloc().
#define CALL_MORECORE | ( | S | ) | MORECORE_DEFAULT(S) |
Define CALL_MORECORE.
Definition at line 1558 of file mymalloc.cc.
Referenced by sys_alloc(), and sys_trim().
#define CALL_MREMAP | ( | addr, | |
osz, | |||
nsz, | |||
mv | |||
) | MFAIL |
Define CALL_MREMAP.
Definition at line 1606 of file mymalloc.cc.
Referenced by mmap_resize(), and sys_trim().
#define CALL_MUNMAP | ( | a, | |
s | |||
) | MUNMAP_DEFAULT((a), (s)) |
Definition at line 1578 of file mymalloc.cc.
Referenced by destroy_mspace(), dlfree(), mspace_free(), release_unused_segments(), and sys_trim().
#define calloc_must_clear | ( | p | ) | (!is_mmapped(p)) |
Definition at line 2167 of file mymalloc.cc.
Referenced by dlcalloc(), and mspace_calloc().
#define check_free_chunk | ( | M, | |
P | |||
) |
Definition at line 2651 of file mymalloc.cc.
Referenced by dlfree(), mspace_free(), and prepend_alloc().
#define check_inuse_chunk | ( | M, | |
P | |||
) |
Definition at line 2652 of file mymalloc.cc.
Referenced by dlfree(), ialloc(), internal_memalign(), internal_realloc(), and mspace_free().
#define check_malloc_state | ( | M | ) |
Definition at line 2655 of file mymalloc.cc.
Referenced by internal_mallinfo(), and internal_malloc_stats().
#define check_malloced_chunk | ( | M, | |
P, | |||
N | |||
) |
Definition at line 2653 of file mymalloc.cc.
Referenced by dlmalloc(), mspace_malloc(), prepend_alloc(), and sys_alloc().
#define check_mmapped_chunk | ( | M, | |
P | |||
) |
Definition at line 2654 of file mymalloc.cc.
Referenced by mmap_alloc(), and mmap_resize().
#define check_top_chunk | ( | M, | |
P | |||
) |
Definition at line 2656 of file mymalloc.cc.
Referenced by add_segment(), dlmalloc(), init_user_mstate(), mspace_malloc(), prepend_alloc(), sys_alloc(), and sys_trim().
#define chunk2mem | ( | p | ) | ((void*)((char*)(p) + TWO_SIZE_T_SIZES)) |
Definition at line 2091 of file mymalloc.cc.
Referenced by add_segment(), dlmalloc(), ialloc(), init_top(), init_user_mstate(), internal_memalign(), internal_realloc(), mmap_alloc(), mspace_malloc(), prepend_alloc(), sys_alloc(), tmalloc_large(), and tmalloc_small().
#define CHUNK_ALIGN_MASK (MALLOC_ALIGNMENT - SIZE_T_ONE) |
Definition at line 1456 of file mymalloc.cc.
Referenced by add_segment(), mmap_alloc(), and mmap_resize().
Definition at line 2140 of file mymalloc.cc.
Referenced by dlfree(), and mspace_free().
#define CHUNK_OVERHEAD (SIZE_T_SIZE) |
Definition at line 2078 of file mymalloc.cc.
Referenced by ialloc(), and internal_memalign().
Definition at line 2139 of file mymalloc.cc.
Referenced by add_segment(), dlfree(), dlmalloc(), ialloc(), init_top(), internal_memalign(), internal_realloc(), mmap_alloc(), mmap_resize(), mspace_free(), mspace_malloc(), prepend_alloc(), sys_alloc(), tmalloc_large(), and tmalloc_small().
#define chunksize | ( | p | ) | ((p)->head & ~(FLAG_BITS)) |
Definition at line 2134 of file mymalloc.cc.
Referenced by dlfree(), dlmalloc(), dlmalloc_usable_size(), ialloc(), internal_mallinfo(), internal_malloc_stats(), internal_memalign(), internal_realloc(), mmap_resize(), mspace_free(), mspace_malloc(), mspace_usable_size(), prepend_alloc(), release_unused_segments(), tmalloc_large(), and tmalloc_small().
#define cinuse | ( | p | ) | ((p)->head & CINUSE_BIT) |
Definition at line 2129 of file mymalloc.cc.
Referenced by dlfree(), and mspace_free().
#define CINUSE_BIT (SIZE_T_TWO) |
Definition at line 2120 of file mymalloc.cc.
#define clear_pinuse | ( | p | ) | ((p)->head &= ~PINUSE_BIT) |
Definition at line 2136 of file mymalloc.cc.
#define clear_smallmap | ( | M, | |
i | |||
) | ((M)->smallmap &= ~idx2bit(i)) |
Definition at line 2778 of file mymalloc.cc.
#define clear_treemap | ( | M, | |
i | |||
) | ((M)->treemap &= ~idx2bit(i)) |
Definition at line 2782 of file mymalloc.cc.
Definition at line 1477 of file mymalloc.cc.
Referenced by create_mspace(), mmap_alloc(), mmap_resize(), sys_alloc(), and sys_trim().
#define compute_bit2idx | ( | X, | |
I | |||
) |
Definition at line 2824 of file mymalloc.cc.
Referenced by dlmalloc(), mspace_malloc(), tmalloc_large(), and tmalloc_small().
#define compute_tree_index | ( | S, | |
I | |||
) |
Definition at line 2737 of file mymalloc.cc.
Referenced by tmalloc_large().
Definition at line 2638 of file mymalloc.cc.
Referenced by tmalloc_large(), and tmalloc_small().
#define DEBUG 0 |
Definition at line 1311 of file mymalloc.cc.
Referenced by G4GMocrenIO::retrieveData2(), G4GMocrenIO::retrieveData3(), G4GMocrenIO::retrieveData4(), G4GMocrenIO::storeData2(), G4GMocrenIO::storeData3(), and G4GMocrenIO::storeData4().
#define DEFAULT_GRANULARITY (0) /* 0 means to compute in init_mparams */ |
Definition at line 620 of file mymalloc.cc.
Referenced by init_mparams().
#define DEFAULT_MMAP_THRESHOLD ((size_t)256U * (size_t)1024U) |
Definition at line 634 of file mymalloc.cc.
Referenced by init_mparams().
#define DEFAULT_TRIM_THRESHOLD ((size_t)2U * (size_t)1024U * (size_t)1024U) |
Definition at line 627 of file mymalloc.cc.
Referenced by init_mparams().
#define DIRECT_MMAP_DEFAULT | ( | s | ) | MMAP_DEFAULT(s) |
Definition at line 1503 of file mymalloc.cc.
#define disable_contiguous | ( | M | ) | ((M)->mflags |= USE_NONCONTIGUOUS_BIT) |
Definition at line 2519 of file mymalloc.cc.
Referenced by init_user_mstate(), and sys_alloc().
#define disable_lock | ( | M | ) | ((M)->mflags &= ~USE_LOCK_BIT) |
Definition at line 2512 of file mymalloc.cc.
#define disable_mmap | ( | M | ) | ((M)->mflags &= ~USE_MMAP_BIT) |
Definition at line 2516 of file mymalloc.cc.
Referenced by ialloc(), and mspace_track_large_chunks().
#define dlcalloc mycalloc |
Definition at line 760 of file mymalloc.cc.
#define dlfree myfree |
Definition at line 761 of file mymalloc.cc.
Referenced by dlrealloc().
#define dlindependent_calloc myindependent_calloc |
Definition at line 774 of file mymalloc.cc.
#define dlindependent_comalloc myindependent_comalloc |
Definition at line 775 of file mymalloc.cc.
#define dlmallinfo mymallinfo |
Definition at line 767 of file mymalloc.cc.
#define dlmalloc mymalloc |
Definition at line 762 of file mymalloc.cc.
Referenced by dlcalloc(), and dlrealloc().
#define dlmalloc_footprint mymalloc_footprint |
Definition at line 772 of file mymalloc.cc.
#define dlmalloc_max_footprint mymalloc_max_footprint |
Definition at line 773 of file mymalloc.cc.
void dlmalloc_stats mymalloc_stats |
Definition at line 770 of file mymalloc.cc.
#define dlmalloc_trim mymalloc_trim |
Definition at line 769 of file mymalloc.cc.
#define dlmalloc_usable_size mymalloc_usable_size |
Definition at line 771 of file mymalloc.cc.
#define DLMALLOC_VERSION 20804 |
Definition at line 488 of file mymalloc.cc.
#define dlmallopt mymallopt |
Definition at line 768 of file mymalloc.cc.
#define dlmemalign mymemalign |
Definition at line 763 of file mymalloc.cc.
Referenced by dlpvalloc(), and dlvalloc().
#define dlpvalloc mypvalloc |
Definition at line 766 of file mymalloc.cc.
#define dlrealloc myrealloc |
Definition at line 764 of file mymalloc.cc.
#define dlvalloc myvalloc |
Definition at line 765 of file mymalloc.cc.
#define enable_lock | ( | M | ) | ((M)->mflags |= USE_LOCK_BIT) |
Definition at line 2511 of file mymalloc.cc.
#define enable_mmap | ( | M | ) | ((M)->mflags |= USE_MMAP_BIT) |
Definition at line 2515 of file mymalloc.cc.
Referenced by ialloc(), and mspace_track_large_chunks().
#define ensure_initialization | ( | ) | (void)(mparams.magic != 0 || init_mparams()) |
Definition at line 2493 of file mymalloc.cc.
Referenced by change_mparam(), create_mspace(), create_mspace_with_base(), dlmalloc(), dlmalloc_trim(), dlpvalloc(), dlvalloc(), ialloc(), internal_mallinfo(), internal_malloc_stats(), sys_alloc(), and sys_trim().
#define EXTERN_BIT (8U) |
Definition at line 1613 of file mymalloc.cc.
Referenced by create_mspace_with_base(), and destroy_mspace().
#define FENCEPOST_HEAD (INUSE_BITS|SIZE_T_SIZE) |
Definition at line 2126 of file mymalloc.cc.
Referenced by add_segment(), internal_mallinfo(), internal_malloc_stats(), mmap_alloc(), and mmap_resize().
#define FLAG4_BIT (SIZE_T_FOUR) |
Definition at line 2121 of file mymalloc.cc.
#define FLAG_BITS (PINUSE_BIT|CINUSE_BIT|FLAG4_BIT) |
Definition at line 2123 of file mymalloc.cc.
#define fm gm |
Referenced by G4VMultipleScattering::AddEmModel(), G4VEmProcess::AddEmModel(), G4hPairProductionModel::ComputeDMicroscopicCrossSection(), G4MuPairProductionModel::ComputeDMicroscopicCrossSection(), MuCrossSections::CRP_Mephi(), dlfree(), G4VEnergyLossProcess::GetDEDXDispersion(), G4ExcitedXiConstructor::GetMass(), G4ePolarizedBremsstrahlung::InitialiseEnergyLossProcess(), G4hPairProduction::InitialiseEnergyLossProcess(), G4hBremsstrahlung::InitialiseEnergyLossProcess(), G4MuPairProduction::InitialiseEnergyLossProcess(), G4eBremsstrahlung::InitialiseEnergyLossProcess(), G4MuBremsstrahlung::InitialiseEnergyLossProcess(), mspace_free(), G4EmConfigurator::PrepareModels(), G4WentzelVIRelXSection::SampleSingleScattering(), and G4WentzelOKandVIxSection::SampleSingleScattering().
#define FOOTERS 0 |
Definition at line 563 of file mymalloc.cc.
#define FORCEINLINE |
Definition at line 752 of file mymalloc.cc.
#define FOUR_SIZE_T_SIZES (SIZE_T_SIZE<<2) |
Definition at line 1451 of file mymalloc.cc.
Referenced by add_segment().
Definition at line 2150 of file mymalloc.cc.
#define gm (&_gm_) |
Definition at line 2499 of file mymalloc.cc.
Referenced by dlindependent_calloc(), dlindependent_comalloc(), dlmallinfo(), dlmalloc(), dlmalloc_footprint(), dlmalloc_max_footprint(), dlmalloc_stats(), dlmalloc_trim(), dlmemalign(), dlrealloc(), and init_mparams().
#define granularity_align | ( | S | ) |
#define HALF_MAX_SIZE_T (MAX_SIZE_T / 2U) |
Definition at line 1453 of file mymalloc.cc.
Referenced by sys_alloc(), and sys_trim().
#define HAVE_MMAP 1 |
Definition at line 588 of file mymalloc.cc.
Referenced by create_mspace(), sys_alloc(), and sys_trim().
#define HAVE_MORECORE 1 |
Definition at line 607 of file mymalloc.cc.
Referenced by create_mspace(), sys_alloc(), and sys_trim().
#define HAVE_MREMAP 0 |
Definition at line 597 of file mymalloc.cc.
#define idx2bit | ( | i | ) | ((binmap_t)(1) << (i)) |
Definition at line 2774 of file mymalloc.cc.
Referenced by dlmalloc(), mspace_malloc(), and tmalloc_large().
#define INITIAL_LOCK | ( | l | ) |
Definition at line 1904 of file mymalloc.cc.
Referenced by init_mparams(), and init_user_mstate().
#define INSECURE 0 |
Definition at line 585 of file mymalloc.cc.
#define insert_chunk | ( | M, | |
P, | |||
S | |||
) |
Definition at line 3629 of file mymalloc.cc.
Referenced by add_segment(), prepend_alloc(), and tmalloc_large().
#define insert_large_chunk | ( | M, | |
X, | |||
S | |||
) |
Definition at line 3488 of file mymalloc.cc.
Referenced by dlfree(), mspace_free(), and release_unused_segments().
#define insert_small_chunk | ( | M, | |
P, | |||
S | |||
) |
Definition at line 3415 of file mymalloc.cc.
Referenced by dlfree(), and mspace_free().
Definition at line 3647 of file mymalloc.cc.
Referenced by internal_memalign(), and internal_realloc().
Definition at line 3645 of file mymalloc.cc.
Referenced by ialloc(), internal_memalign(), internal_realloc(), and mspace_calloc().
#define INUSE_BITS (PINUSE_BIT|CINUSE_BIT) |
Definition at line 2122 of file mymalloc.cc.
Referenced by dlfree(), init_user_mstate(), and mspace_free().
#define is_aligned | ( | A | ) | (((size_t)((A)) & (CHUNK_ALIGN_MASK)) == 0) |
Definition at line 1459 of file mymalloc.cc.
Referenced by add_segment(), and mmap_alloc().
#define is_extern_segment | ( | S | ) | ((S)->sflags & EXTERN_BIT) |
Definition at line 2347 of file mymalloc.cc.
Referenced by release_unused_segments(), sys_alloc(), and sys_trim().
#define is_global | ( | M | ) | ((M) == &_gm_) |
Definition at line 2500 of file mymalloc.cc.
Referenced by sys_alloc().
#define is_granularity_aligned | ( | S | ) | (((size_t)(S) & (mparams.granularity - SIZE_T_ONE)) == 0) |
Definition at line 2548 of file mymalloc.cc.
#define is_initialized | ( | M | ) | ((M)->top != 0) |
Definition at line 2504 of file mymalloc.cc.
Referenced by internal_mallinfo(), internal_malloc_stats(), sys_alloc(), and sys_trim().
#define is_inuse | ( | p | ) | (((p)->head & INUSE_BITS) != PINUSE_BIT) |
Definition at line 2131 of file mymalloc.cc.
Referenced by dlmalloc_usable_size(), internal_mallinfo(), internal_malloc_stats(), mspace_usable_size(), prepend_alloc(), and release_unused_segments().
#define is_mmapped | ( | p | ) | (((p)->head & INUSE_BITS) == 0) |
Definition at line 2132 of file mymalloc.cc.
Referenced by dlfree(), ialloc(), internal_memalign(), internal_realloc(), and mspace_free().
#define is_mmapped_segment | ( | S | ) | ((S)->sflags & USE_MMAP_BIT) |
Definition at line 2346 of file mymalloc.cc.
Referenced by release_unused_segments(), and sys_trim().
#define is_page_aligned | ( | S | ) | (((size_t)(S) & (mparams.page_size - SIZE_T_ONE)) == 0) |
Definition at line 2546 of file mymalloc.cc.
Referenced by sys_alloc().
#define is_small | ( | s | ) | (((s) >> SMALLBIN_SHIFT) < NSMALLBINS) |
Definition at line 2682 of file mymalloc.cc.
Referenced by dlfree(), mmap_resize(), and mspace_free().
#define least_bit | ( | x | ) | ((x) & -(x)) |
Definition at line 2786 of file mymalloc.cc.
Referenced by dlmalloc(), mspace_malloc(), tmalloc_large(), and tmalloc_small().
#define left_bits | ( | x | ) | ((x<<1) | -(x<<1)) |
Definition at line 2789 of file mymalloc.cc.
Referenced by dlmalloc(), mspace_malloc(), and tmalloc_large().
#define leftmost_child | ( | t | ) | ((t)->child[0] != 0? (t)->child[0] : (t)->child[1]) |
Definition at line 2280 of file mymalloc.cc.
Referenced by tmalloc_large(), and tmalloc_small().
#define leftshift_for_tree_index | ( | i | ) |
Definition at line 2761 of file mymalloc.cc.
Referenced by tmalloc_large().
#define M_GRANULARITY (-2) |
Definition at line 670 of file mymalloc.cc.
Referenced by change_mparam().
#define M_MMAP_THRESHOLD (-3) |
Definition at line 671 of file mymalloc.cc.
Referenced by change_mparam().
#define M_TRIM_THRESHOLD (-1) |
Definition at line 669 of file mymalloc.cc.
Referenced by change_mparam().
#define MALLINFO_FIELD_TYPE size_t |
Definition at line 656 of file mymalloc.cc.
#define MALLOC_ALIGNMENT ((size_t)8U) |
Definition at line 560 of file mymalloc.cc.
Referenced by init_mparams(), and internal_memalign().
#define MALLOC_FAILURE_ACTION errno = ENOMEM; |
Definition at line 601 of file mymalloc.cc.
Referenced by internal_memalign(), internal_realloc(), and sys_alloc().
#define malloc_getpagesize ((size_t)4096U) |
Definition at line 1425 of file mymalloc.cc.
Referenced by init_mparams().
#define mark_inuse_foot | ( | M, | |
p, | |||
s | |||
) |
Definition at line 2906 of file mymalloc.cc.
Referenced by mmap_alloc(), and mmap_resize().
#define mark_smallmap | ( | M, | |
i | |||
) | ((M)->smallmap |= idx2bit(i)) |
Definition at line 2777 of file mymalloc.cc.
#define mark_treemap | ( | M, | |
i | |||
) | ((M)->treemap |= idx2bit(i)) |
Definition at line 2781 of file mymalloc.cc.
#define MAX_RELEASE_CHECK_RATE 4095 |
Definition at line 641 of file mymalloc.cc.
Referenced by init_user_mstate(), release_unused_segments(), and sys_alloc().
#define MAX_REQUEST ((-MIN_CHUNK_SIZE) << 2) |
Definition at line 2097 of file mymalloc.cc.
Referenced by dlmalloc(), internal_memalign(), internal_realloc(), mspace_malloc(), and sys_trim().
#define MAX_SIZE_T (~(size_t)0) |
Definition at line 545 of file mymalloc.cc.
Referenced by change_mparam(), dlcalloc(), dlmalloc(), init_mparams(), mspace_calloc(), mspace_malloc(), and sys_trim().
#define MAX_SMALL_REQUEST (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD) |
Definition at line 2444 of file mymalloc.cc.
Referenced by dlmalloc(), and mspace_malloc().
#define MAX_SMALL_SIZE (MIN_LARGE_SIZE - SIZE_T_ONE) |
Definition at line 2443 of file mymalloc.cc.
#define MCHUNK_SIZE (sizeof(mchunk)) |
Definition at line 2073 of file mymalloc.cc.
Referenced by init_mparams().
#define mem2chunk | ( | mem | ) | ((mchunkptr)((char*)(mem) - TWO_SIZE_T_SIZES)) |
Definition at line 2092 of file mymalloc.cc.
Referenced by dlcalloc(), dlfree(), dlmalloc_usable_size(), dlrealloc(), ialloc(), init_user_mstate(), internal_memalign(), internal_realloc(), mspace_calloc(), mspace_free(), mspace_realloc(), mspace_usable_size(), and sys_alloc().
#define MFAIL ((void*)(MAX_SIZE_T)) |
Definition at line 1476 of file mymalloc.cc.
Referenced by sys_trim().
#define MIN_CHUNK_SIZE ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) |
Definition at line 2087 of file mymalloc.cc.
Referenced by add_segment(), dlmalloc(), init_mparams(), internal_memalign(), internal_realloc(), mspace_malloc(), prepend_alloc(), tmalloc_large(), and tmalloc_small().
#define MIN_LARGE_SIZE (SIZE_T_ONE << TREEBIN_SHIFT) |
Definition at line 2442 of file mymalloc.cc.
#define MIN_REQUEST (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE) |
Definition at line 2098 of file mymalloc.cc.
Referenced by dlmalloc(), and mspace_malloc().
#define MIN_SMALL_INDEX (small_index(MIN_CHUNK_SIZE)) |
Definition at line 2685 of file mymalloc.cc.
#define minsize_for_tree_index | ( | i | ) |
Definition at line 2766 of file mymalloc.cc.
#define mmap_align | ( | S | ) | page_align(S) |
Definition at line 2540 of file mymalloc.cc.
Referenced by mmap_alloc(), and mmap_resize().
#define MMAP_CHUNK_OVERHEAD (TWO_SIZE_T_SIZES) |
Definition at line 2082 of file mymalloc.cc.
#define MMAP_CLEARS 1 |
Definition at line 591 of file mymalloc.cc.
#define MMAP_DEFAULT | ( | s | ) |
Definition at line 1497 of file mymalloc.cc.
#define MMAP_FLAGS (MAP_PRIVATE) |
Definition at line 1495 of file mymalloc.cc.
#define MMAP_FOOT_PAD (FOUR_SIZE_T_SIZES) |
Definition at line 2084 of file mymalloc.cc.
Referenced by dlfree(), mmap_alloc(), mmap_resize(), and mspace_free().
#define MMAP_PROT (PROT_READ|PROT_WRITE) |
Definition at line 1483 of file mymalloc.cc.
#define MORECORE_CONTIGUOUS 1 |
Definition at line 615 of file mymalloc.cc.
Referenced by sys_alloc().
#define MORECORE_DEFAULT sbrk |
Definition at line 613 of file mymalloc.cc.
#define MSPACES 1 |
Definition at line 485 of file mymalloc.cc.
Referenced by create_mspace().
Definition at line 2143 of file mymalloc.cc.
Referenced by init_user_mstate(), internal_mallinfo(), internal_malloc_stats(), and sys_alloc().
#define next_pinuse | ( | p | ) | ((next_chunk(p)->head) & PINUSE_BIT) |
Definition at line 2147 of file mymalloc.cc.
#define NO_MALLINFO 0 |
Definition at line 653 of file mymalloc.cc.
#define NO_SEGMENT_TRAVERSAL 0 |
Definition at line 659 of file mymalloc.cc.
Referenced by release_unused_segments(), and sys_alloc().
#define NOINLINE |
Definition at line 741 of file mymalloc.cc.
#define NSMALLBINS (32U) |
Definition at line 2437 of file mymalloc.cc.
Referenced by init_bins().
#define NTREEBINS (32U) |
Definition at line 2438 of file mymalloc.cc.
Definition at line 2868 of file mymalloc.cc.
Referenced by dlfree(), internal_realloc(), mspace_free(), tmalloc_large(), and tmalloc_small().
#define ok_inuse | ( | p | ) | is_inuse(p) |
Definition at line 2872 of file mymalloc.cc.
Referenced by dlfree(), internal_realloc(), and mspace_free().
#define ok_magic | ( | M | ) | (1) |
Definition at line 2887 of file mymalloc.cc.
Referenced by destroy_mspace(), dlfree(), dlrealloc(), mspace_calloc(), mspace_footprint(), mspace_free(), mspace_independent_calloc(), mspace_independent_comalloc(), mspace_mallinfo(), mspace_malloc(), mspace_malloc_stats(), mspace_max_footprint(), mspace_memalign(), mspace_realloc(), and mspace_trim().
Definition at line 2870 of file mymalloc.cc.
Referenced by dlfree(), internal_realloc(), mspace_free(), tmalloc_large(), and tmalloc_small().
#define ok_pinuse | ( | p | ) | pinuse(p) |
Definition at line 2874 of file mymalloc.cc.
Referenced by dlfree(), internal_realloc(), and mspace_free().
#define ONLY_MSPACES 0 /* define to a value */ |
Definition at line 548 of file mymalloc.cc.
Referenced by create_mspace().
#define overhead_for | ( | p | ) | (is_mmapped(p)? MMAP_CHUNK_OVERHEAD : CHUNK_OVERHEAD) |
Definition at line 2162 of file mymalloc.cc.
Referenced by dlmalloc_usable_size(), internal_realloc(), and mspace_usable_size().
#define pad_request | ( | req | ) | (((req) + CHUNK_OVERHEAD + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) |
Definition at line 2101 of file mymalloc.cc.
Referenced by add_segment(), create_mspace(), create_mspace_with_base(), dlmalloc(), init_user_mstate(), and mspace_malloc().
#define page_align | ( | S | ) | (((S) + (mparams.page_size - SIZE_T_ONE)) & ~(mparams.page_size - SIZE_T_ONE)) |
Definition at line 2527 of file mymalloc.cc.
Referenced by sys_alloc().
#define pinuse | ( | p | ) | ((p)->head & PINUSE_BIT) |
Definition at line 2130 of file mymalloc.cc.
Referenced by dlfree(), mspace_free(), and prepend_alloc().
#define PINUSE_BIT (SIZE_T_ONE) |
Definition at line 2119 of file mymalloc.cc.
Referenced by dlfree(), dlmalloc(), init_top(), internal_realloc(), mspace_free(), mspace_malloc(), prepend_alloc(), and sys_alloc().
#define POSTACTION | ( | M | ) |
Definition at line 2611 of file mymalloc.cc.
Referenced by dlfree(), dlmalloc(), dlmalloc_trim(), ialloc(), internal_mallinfo(), internal_malloc_stats(), internal_memalign(), internal_realloc(), mspace_free(), mspace_malloc(), mspace_track_large_chunks(), and mspace_trim().
#define PREACTION | ( | M | ) | (0) |
Definition at line 2607 of file mymalloc.cc.
Referenced by dlfree(), dlmalloc(), dlmalloc_trim(), ialloc(), internal_mallinfo(), internal_malloc_stats(), internal_memalign(), internal_realloc(), mspace_free(), mspace_malloc(), mspace_track_large_chunks(), and mspace_trim().
#define prev_chunk | ( | p | ) | ((mchunkptr)( ((char*)(p)) - ((p)->prev_foot) )) |
Definition at line 2144 of file mymalloc.cc.
#define PROCEED_ON_ERROR 0 |
Definition at line 572 of file mymalloc.cc.
#define RELEASE_MALLOC_GLOBAL_LOCK | ( | ) |
Definition at line 1916 of file mymalloc.cc.
Referenced by init_mparams(), sys_alloc(), and sys_trim().
#define replace_dv | ( | M, | |
P, | |||
S | |||
) |
Definition at line 3474 of file mymalloc.cc.
Referenced by dlmalloc(), mspace_malloc(), and tmalloc_small().
#define request2size | ( | req | ) | (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req)) |
Definition at line 2105 of file mymalloc.cc.
Referenced by ialloc(), internal_memalign(), and internal_realloc().
#define RTCHECK | ( | e | ) | (e) |
Definition at line 2896 of file mymalloc.cc.
Referenced by dlfree(), internal_realloc(), mspace_free(), tmalloc_large(), and tmalloc_small().
#define same_or_left_bits | ( | x | ) | ((x) | -(x)) |
Definition at line 2792 of file mymalloc.cc.
Definition at line 2552 of file mymalloc.cc.
Referenced by internal_mallinfo(), internal_malloc_stats(), release_unused_segments(), and sys_alloc().
Definition at line 2151 of file mymalloc.cc.
#define set_free_with_pinuse | ( | p, | |
s, | |||
n | |||
) | (clear_pinuse(n), set_size_and_pinuse_of_free_chunk(p, s)) |
Definition at line 2158 of file mymalloc.cc.
Referenced by add_segment(), dlfree(), mspace_free(), and prepend_alloc().
#define set_inuse | ( | M, | |
p, | |||
s | |||
) |
Definition at line 2911 of file mymalloc.cc.
Referenced by internal_memalign(), and internal_realloc().
#define set_inuse_and_pinuse | ( | M, | |
p, | |||
s | |||
) |
Definition at line 2916 of file mymalloc.cc.
Referenced by dlmalloc(), internal_realloc(), mspace_malloc(), tmalloc_large(), and tmalloc_small().
#define set_lock | ( | M, | |
L | |||
) |
Definition at line 2521 of file mymalloc.cc.
Referenced by create_mspace(), and create_mspace_with_base().
#define set_size_and_pinuse_of_free_chunk | ( | p, | |
s | |||
) | ((p)->head = (s|PINUSE_BIT), set_foot(p, s)) |
Definition at line 2154 of file mymalloc.cc.
Referenced by dlfree(), dlmalloc(), mspace_free(), mspace_malloc(), 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 2921 of file mymalloc.cc.
Referenced by add_segment(), dlmalloc(), ialloc(), mspace_malloc(), prepend_alloc(), sys_alloc(), tmalloc_large(), and tmalloc_small().
Definition at line 2578 of file mymalloc.cc.
Referenced by dlfree(), and mspace_free().
#define SIX_SIZE_T_SIZES (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES) |
Definition at line 1452 of file mymalloc.cc.
Referenced by mmap_alloc(), and mmap_resize().
#define SIZE_T_BITSIZE (sizeof(size_t) << 3) |
Definition at line 1442 of file mymalloc.cc.
Referenced by tmalloc_large().
#define SIZE_T_FOUR ((size_t)4) |
Definition at line 1449 of file mymalloc.cc.
#define SIZE_T_ONE ((size_t)1) |
Definition at line 1447 of file mymalloc.cc.
Referenced by dlpvalloc(), init_mparams(), internal_mallinfo(), internal_memalign(), sys_trim(), and tmalloc_large().
#define SIZE_T_SIZE (sizeof(size_t)) |
Definition at line 1441 of file mymalloc.cc.
Referenced by add_segment(), dlmalloc(), ialloc(), mmap_alloc(), mmap_resize(), and mspace_malloc().
#define SIZE_T_TWO ((size_t)2) |
Definition at line 1448 of file mymalloc.cc.
#define SIZE_T_ZERO ((size_t)0) |
Definition at line 1446 of file mymalloc.cc.
#define small_index | ( | s | ) | ((s) >> SMALLBIN_SHIFT) |
Definition at line 2683 of file mymalloc.cc.
Referenced by dlmalloc(), and mspace_malloc().
#define small_index2size | ( | i | ) | ((i) << SMALLBIN_SHIFT) |
Definition at line 2684 of file mymalloc.cc.
Referenced by dlmalloc(), and mspace_malloc().
#define smallbin_at | ( | M, | |
i | |||
) | ((sbinptr)((char*)&((M)->smallbins[(i)<<1]))) |
Definition at line 2688 of file mymalloc.cc.
Referenced by dlmalloc(), init_bins(), and mspace_malloc().
#define SMALLBIN_SHIFT (3U) |
Definition at line 2439 of file mymalloc.cc.
#define SMALLBIN_WIDTH (SIZE_T_ONE << SMALLBIN_SHIFT) |
Definition at line 2440 of file mymalloc.cc.
#define smallmap_is_marked | ( | M, | |
i | |||
) | ((M)->smallmap & idx2bit(i)) |
Definition at line 2779 of file mymalloc.cc.
#define SPIN_LOCKS_AVAILABLE 0 |
Definition at line 541 of file mymalloc.cc.
#define STRUCT_MALLINFO_DECLARED 1 |
Definition at line 706 of file mymalloc.cc.
#define SYS_ALLOC_PADDING (TOP_FOOT_SIZE + MALLOC_ALIGNMENT) |
Definition at line 2544 of file mymalloc.cc.
Referenced by sys_alloc().
#define TOP_FOOT_SIZE (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE) |
Definition at line 2588 of file mymalloc.cc.
Referenced by add_segment(), create_mspace(), create_mspace_with_base(), init_top(), init_user_mstate(), internal_mallinfo(), internal_malloc_stats(), release_unused_segments(), sys_alloc(), and sys_trim().
#define treebin_at | ( | M, | |
i | |||
) | (&((M)->treebins[i])) |
Definition at line 2689 of file mymalloc.cc.
Referenced by tmalloc_large(), and tmalloc_small().
#define TREEBIN_SHIFT (8U) |
Definition at line 2441 of file mymalloc.cc.
#define treemap_is_marked | ( | M, | |
i | |||
) | ((M)->treemap & idx2bit(i)) |
Definition at line 2783 of file mymalloc.cc.
#define TWO_SIZE_T_SIZES (SIZE_T_SIZE<<1) |
Definition at line 1450 of file mymalloc.cc.
#define unlink_chunk | ( | M, | |
P, | |||
S | |||
) |
Definition at line 3633 of file mymalloc.cc.
Referenced by dlfree(), mspace_free(), and prepend_alloc().
#define unlink_first_small_chunk | ( | M, | |
B, | |||
P, | |||
I | |||
) |
Definition at line 3454 of file mymalloc.cc.
Referenced by dlmalloc(), and mspace_malloc().
#define unlink_large_chunk | ( | M, | |
X | |||
) |
Definition at line 3556 of file mymalloc.cc.
Referenced by release_unused_segments(), tmalloc_large(), and tmalloc_small().
#define unlink_small_chunk | ( | M, | |
P, | |||
S | |||
) |
Definition at line 3434 of file mymalloc.cc.
Definition at line 2642 of file mymalloc.cc.
Referenced by destroy_mspace(), dlfree(), dlrealloc(), internal_realloc(), mspace_calloc(), mspace_footprint(), mspace_free(), mspace_independent_calloc(), mspace_independent_comalloc(), mspace_mallinfo(), mspace_malloc(), mspace_malloc_stats(), mspace_max_footprint(), mspace_memalign(), mspace_realloc(), and mspace_trim().
#define USE_BUILTIN_FFS 0 |
Definition at line 647 of file mymalloc.cc.
#define USE_DEV_RANDOM 0 |
Definition at line 650 of file mymalloc.cc.
#define use_lock | ( | M | ) | ((M)->mflags & USE_LOCK_BIT) |
Definition at line 2510 of file mymalloc.cc.
#define USE_LOCK_BIT (0U) |
Definition at line 1903 of file mymalloc.cc.
Referenced by init_mparams().
#define USE_LOCKS 0 |
Definition at line 575 of file mymalloc.cc.
Referenced by create_mspace().
#define use_mmap | ( | M | ) | ((M)->mflags & USE_MMAP_BIT) |
Definition at line 2514 of file mymalloc.cc.
Referenced by ialloc(), mspace_track_large_chunks(), and sys_alloc().
#define USE_MMAP_BIT (SIZE_T_ONE) |
Define CALL_MMAP/CALL_MUNMAP/CALL_DIRECT_MMAP.
Definition at line 1568 of file mymalloc.cc.
Referenced by create_mspace(), destroy_mspace(), init_mparams(), and sys_alloc().
#define use_noncontiguous | ( | M | ) | ((M)->mflags & USE_NONCONTIGUOUS_BIT) |
Definition at line 2518 of file mymalloc.cc.
Referenced by sys_alloc().
#define USE_NONCONTIGUOUS_BIT (4U) |
Definition at line 1610 of file mymalloc.cc.
Referenced by init_mparams().
#define USE_SPIN_LOCKS 0 |
Definition at line 581 of file mymalloc.cc.
typedef unsigned int bindex_t |
Definition at line 2067 of file mymalloc.cc.
typedef unsigned int binmap_t |
Definition at line 2068 of file mymalloc.cc.
typedef unsigned int flag_t |
Definition at line 2069 of file mymalloc.cc.
typedef struct malloc_chunk mchunk |
Definition at line 2064 of file mymalloc.cc.
typedef struct malloc_chunk* mchunkptr |
Definition at line 2065 of file mymalloc.cc.
typedef struct malloc_segment msegment |
Definition at line 2349 of file mymalloc.cc.
typedef struct malloc_segment* msegmentptr |
Definition at line 2350 of file mymalloc.cc.
typedef void* mspace |
Definition at line 1123 of file mymalloc.cc.
typedef struct malloc_state* mstate |
Definition at line 2470 of file mymalloc.cc.
typedef struct malloc_chunk* sbinptr |
Definition at line 2066 of file mymalloc.cc.
typedef struct malloc_tree_chunk* tbinptr |
Definition at line 2277 of file mymalloc.cc.
typedef struct malloc_tree_chunk tchunk |
Definition at line 2275 of file mymalloc.cc.
typedef struct malloc_tree_chunk* tchunkptr |
Definition at line 2276 of file mymalloc.cc.
Definition at line 3815 of file mymalloc.cc.
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 |
Definition at line 3038 of file mymalloc.cc.
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(), and mspace_mallopt().
mspace create_mspace | ( | size_t | capacity, |
int | locked | ||
) |
Definition at line 4974 of file mymalloc.cc.
References CALL_MMAP, CMFAIL, ensure_initialization, malloc_params::granularity, granularity_align, HAVE_MMAP, HAVE_MORECORE, init_user_mstate(), m, mparams, MSPACES, ONLY_MSPACES, pad_request, malloc_params::page_size, malloc_state::seg, set_lock, malloc_segment::sflags, TOP_FOOT_SIZE, USE_LOCKS, and USE_MMAP_BIT.
Referenced by calloc(), malloc(), realloc(), and valloc().
mspace create_mspace_with_base | ( | void * | base, |
size_t | capacity, | ||
int | locked | ||
) |
Definition at line 5005 of file mymalloc.cc.
References ensure_initialization, EXTERN_BIT, init_user_mstate(), m, mparams, pad_request, malloc_params::page_size, malloc_state::seg, set_lock, malloc_segment::sflags, and TOP_FOOT_SIZE.
size_t destroy_mspace | ( | mspace | msp | ) |
Definition at line 5034 of file mymalloc.cc.
References malloc_segment::base, CALL_MUNMAP, EXTERN_BIT, ms, malloc_segment::next, ok_magic, malloc_state::seg, malloc_segment::sflags, malloc_segment::size, USAGE_ERROR_ACTION, and USE_MMAP_BIT.
void * dlcalloc | ( | size_t | n_elements, |
size_t | elem_size | ||
) |
Definition at line 4837 of file mymalloc.cc.
References calloc_must_clear, dlmalloc, MAX_SIZE_T, and mem2chunk.
void dlfree | ( | void * | mem | ) |
Definition at line 4728 of file mymalloc.cc.
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, is_small, mem2chunk, MMAP_FOOT_PAD, ok_address, ok_inuse, 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, G4InuclParticleNames::tp, unlink_chunk, and USAGE_ERROR_ACTION.
void** dlindependent_calloc | ( | size_t | , |
size_t | , | ||
void ** | |||
) |
void** dlindependent_calloc | ( | size_t | n_elements, |
size_t | elem_size, | ||
void * | chunks[] | ||
) |
void** dlindependent_comalloc | ( | size_t | , |
size_t * | , | ||
void ** | |||
) |
void** dlindependent_comalloc | ( | size_t | n_elements, |
size_t | sizes[], | ||
void * | chunks[] | ||
) |
struct mallinfo dlmallinfo | ( | void | ) |
Definition at line 4923 of file mymalloc.cc.
References gm, and internal_mallinfo().
void * dlmalloc | ( | size_t | bytes | ) |
Definition at line 4592 of file mymalloc.cc.
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 | ) |
Definition at line 4914 of file mymalloc.cc.
References gm.
size_t dlmalloc_max_footprint | ( | void | ) |
Definition at line 4918 of file mymalloc.cc.
References gm.
void dlmalloc_stats | ( | void | ) |
Definition at line 4928 of file mymalloc.cc.
References gm, and internal_malloc_stats().
int dlmalloc_trim | ( | size_t | pad | ) |
Definition at line 4904 of file mymalloc.cc.
References ensure_initialization, gm, POSTACTION, PREACTION, and sys_trim().
size_t dlmalloc_usable_size | ( | void * | mem | ) |
Definition at line 4938 of file mymalloc.cc.
References chunksize, is_inuse, mem2chunk, and overhead_for.
int dlmallopt | ( | int | param_number, |
int | value | ||
) |
Definition at line 4932 of file mymalloc.cc.
References change_mparam().
void * dlmemalign | ( | size_t | alignment, |
size_t | bytes | ||
) |
Definition at line 4875 of file mymalloc.cc.
References gm, and internal_memalign().
void * dlpvalloc | ( | size_t | bytes | ) |
Definition at line 4897 of file mymalloc.cc.
References dlmemalign, ensure_initialization, mparams, malloc_params::page_size, and SIZE_T_ONE.
void * dlrealloc | ( | void * | oldmem, |
size_t | bytes | ||
) |
Definition at line 4852 of file mymalloc.cc.
References dlfree, dlmalloc, gm, internal_realloc(), mem2chunk, ok_magic, and USAGE_ERROR_ACTION.
void * dlvalloc | ( | size_t | bytes | ) |
Definition at line 4890 of file mymalloc.cc.
References dlmemalign, ensure_initialization, mparams, and malloc_params::page_size.
|
static |
Definition at line 2567 of file mymalloc.cc.
References malloc_segment::base, malloc_segment::next, malloc_state::seg, malloc_segment::size, and G4InuclParticleNames::sp.
Referenced by sys_trim().
|
static |
Definition at line 4460 of file mymalloc.cc.
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(), dlindependent_comalloc(), mspace_independent_calloc(), and mspace_independent_comalloc().
|
static |
Definition at line 3744 of file mymalloc.cc.
References malloc_chunk::bk, malloc_chunk::fd, NSMALLBINS, and smallbin_at.
Referenced by init_user_mstate(), and sys_alloc().
|
static |
Definition at line 2953 of file mymalloc.cc.
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 3729 of file mymalloc.cc.
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(), init_user_mstate(), sys_alloc(), and sys_trim().
|
static |
Definition at line 4951 of file mymalloc.cc.
References align_as_chunk, malloc_segment::base, check_top_chunk, chunk2mem, malloc_params::default_mflags, disable_contiguous, malloc_state::extp, malloc_state::exts, malloc_state::footprint, malloc_chunk::head, init_bins(), init_top(), INITIAL_LOCK, INUSE_BITS, malloc_state::least_addr, m, malloc_state::magic, malloc_params::magic, malloc_state::max_footprint, MAX_RELEASE_CHECK_RATE, mem2chunk, malloc_state::mflags, mparams, next_chunk, pad_request, malloc_state::release_checks, malloc_state::seg, malloc_segment::size, malloc_state::top, and TOP_FOOT_SIZE.
Referenced by create_mspace(), and create_mspace_with_base().
Definition at line 3332 of file mymalloc.cc.
References align_as_chunk, mallinfo::arena, malloc_segment::base, check_malloc_state, chunksize, ensure_initialization, FENCEPOST_HEAD, malloc_state::footprint, mallinfo::fordblks, mallinfo::hblkhd, malloc_chunk::head, is_initialized, is_inuse, 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(), and mspace_mallinfo().
|
static |
Definition at line 3372 of file mymalloc.cc.
References align_as_chunk, malloc_segment::base, check_malloc_state, chunksize, ensure_initialization, FENCEPOST_HEAD, malloc_state::footprint, malloc_chunk::head, is_initialized, is_inuse, 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.
Referenced by dlmalloc_stats(), and mspace_malloc_stats().
|
static |
Definition at line 4373 of file mymalloc.cc.
References a, assert, check_inuse_chunk, chunk2mem, CHUNK_OVERHEAD, chunk_plus_offset, chunksize, malloc_chunk::head, internal_free, internal_malloc, is_mmapped, MALLOC_ALIGNMENT, MALLOC_FAILURE_ACTION, MAX_REQUEST, mem2chunk, MIN_CHUNK_SIZE, pos, POSTACTION, PREACTION, malloc_chunk::prev_foot, request2size, set_inuse, and SIZE_T_ONE.
Referenced by dlmemalign(), and mspace_memalign().
|
static |
Definition at line 4298 of file mymalloc.cc.
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_inuse, ok_next, ok_pinuse, overhead_for, PINUSE_BIT, POSTACTION, PREACTION, request2size, RTCHECK, set_inuse, set_inuse_and_pinuse, malloc_state::top, malloc_state::topsize, and USAGE_ERROR_ACTION.
Referenced by dlrealloc(), and mspace_realloc().
|
static |
Definition at line 3666 of file mymalloc.cc.
References align_offset, assert, CALL_DIRECT_MMAP, check_mmapped_chunk, chunk2mem, CHUNK_ALIGN_MASK, chunk_plus_offset, CMFAIL, FENCEPOST_HEAD, malloc_state::footprint, malloc_chunk::head, is_aligned, malloc_state::least_addr, mark_inuse_foot, malloc_state::max_footprint, mm, mmap_align, MMAP_FOOT_PAD, malloc_chunk::prev_foot, SIX_SIZE_T_SIZES, and SIZE_T_SIZE.
Referenced by sys_alloc().
Definition at line 3693 of file mymalloc.cc.
References CALL_MREMAP, check_mmapped_chunk, CHUNK_ALIGN_MASK, chunk_plus_offset, chunksize, CMFAIL, cp, FENCEPOST_HEAD, malloc_state::footprint, malloc_params::granularity, malloc_chunk::head, 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().
void * mspace_calloc | ( | mspace | msp, |
size_t | n_elements, | ||
size_t | elem_size | ||
) |
Definition at line 5276 of file mymalloc.cc.
References calloc_must_clear, internal_malloc, MAX_SIZE_T, mem2chunk, ms, ok_magic, and USAGE_ERROR_ACTION.
Referenced by calloc().
size_t mspace_footprint | ( | mspace | msp | ) |
Definition at line 5375 of file mymalloc.cc.
References malloc_state::footprint, ms, ok_magic, and USAGE_ERROR_ACTION.
void mspace_free | ( | mspace | msp, |
void * | mem | ||
) |
Definition at line 5175 of file mymalloc.cc.
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, is_small, mem2chunk, MMAP_FOOT_PAD, ok_address, ok_inuse, 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, G4InuclParticleNames::tp, unlink_chunk, and USAGE_ERROR_ACTION.
Referenced by cfree(), free(), and mspace_realloc().
void ** mspace_independent_calloc | ( | mspace | msp, |
size_t | n_elements, | ||
size_t | elem_size, | ||
void * | chunks[] | ||
) |
Definition at line 5329 of file mymalloc.cc.
References ialloc(), ms, ok_magic, and USAGE_ERROR_ACTION.
void ** mspace_independent_comalloc | ( | mspace | msp, |
size_t | n_elements, | ||
size_t | sizes[], | ||
void * | chunks[] | ||
) |
Definition at line 5340 of file mymalloc.cc.
References ialloc(), ms, ok_magic, and USAGE_ERROR_ACTION.
Definition at line 5402 of file mymalloc.cc.
References internal_mallinfo(), ms, ok_magic, and USAGE_ERROR_ACTION.
void * mspace_malloc | ( | mspace | msp, |
size_t | bytes | ||
) |
Definition at line 5061 of file mymalloc.cc.
References assert, check_malloced_chunk, check_top_chunk, chunk2mem, chunk_plus_offset, chunksize, compute_bit2idx, malloc_state::dv, malloc_state::dvsize, malloc_chunk::fd, malloc_chunk::head, idx2bit, least_bit, left_bits, MAX_REQUEST, MAX_SIZE_T, MAX_SMALL_REQUEST, MIN_CHUNK_SIZE, MIN_REQUEST, ms, ok_magic, 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, malloc_state::smallmap, sys_alloc(), tmalloc_large(), tmalloc_small(), malloc_state::top, malloc_state::topsize, malloc_state::treemap, unlink_first_small_chunk, and USAGE_ERROR_ACTION.
Referenced by malloc(), mspace_realloc(), and valloc().
void mspace_malloc_stats | ( | mspace | msp | ) |
Definition at line 5365 of file mymalloc.cc.
References internal_malloc_stats(), ms, ok_magic, and USAGE_ERROR_ACTION.
int mspace_mallopt | ( | int | param_number, |
int | value | ||
) |
Definition at line 5420 of file mymalloc.cc.
References change_mparam().
size_t mspace_max_footprint | ( | mspace | msp | ) |
Definition at line 5388 of file mymalloc.cc.
References malloc_state::max_footprint, ms, ok_magic, and USAGE_ERROR_ACTION.
void * mspace_memalign | ( | mspace | msp, |
size_t | alignment, | ||
size_t | bytes | ||
) |
Definition at line 5320 of file mymalloc.cc.
References internal_memalign(), ms, ok_magic, and USAGE_ERROR_ACTION.
void * mspace_realloc | ( | mspace | msp, |
void * | mem, | ||
size_t | newsize | ||
) |
Definition at line 5296 of file mymalloc.cc.
References internal_realloc(), mem2chunk, ms, mspace_free(), mspace_malloc(), ok_magic, and USAGE_ERROR_ACTION.
Referenced by realloc().
int mspace_track_large_chunks | ( | mspace | msp, |
int | enable | ||
) |
Definition at line 5019 of file mymalloc.cc.
References disable_mmap, enable_mmap, ms, POSTACTION, PREACTION, and use_mmap.
int mspace_trim | ( | mspace | msp, |
size_t | pad | ||
) |
Definition at line 5350 of file mymalloc.cc.
References ms, ok_magic, POSTACTION, PREACTION, sys_trim(), and USAGE_ERROR_ACTION.
size_t mspace_usable_size | ( | void * | mem | ) |
Definition at line 5411 of file mymalloc.cc.
References chunksize, is_inuse, mem2chunk, and overhead_for.
|
static |
Definition at line 3773 of file mymalloc.cc.
References align_as_chunk, assert, check_free_chunk, check_malloced_chunk, check_top_chunk, chunk2mem, chunk_plus_offset, chunksize, malloc_state::dv, malloc_state::dvsize, malloc_chunk::head, insert_chunk, is_inuse, 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 |
Definition at line 4073 of file mymalloc.cc.
References align_as_chunk, assert, malloc_segment::base, CALL_MUNMAP, chunksize, malloc_state::dv, malloc_state::dvsize, malloc_state::footprint, insert_large_chunk, is_extern_segment, is_inuse, 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, G4InuclParticleNames::sp, TOP_FOOT_SIZE, G4InuclParticleNames::tp, and unlink_large_chunk.
Referenced by dlfree(), mspace_free(), and sys_trim().
|
static |
Definition at line 2556 of file mymalloc.cc.
References malloc_segment::base, malloc_segment::next, malloc_state::seg, malloc_segment::size, and G4InuclParticleNames::sp.
Referenced by add_segment(), sys_alloc(), and sys_trim().
|
static |
Definition at line 3870 of file mymalloc.cc.
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_page_aligned, malloc_state::least_addr, malloc_state::magic, malloc_params::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, USE_MMAP_BIT, and use_noncontiguous.
Referenced by dlmalloc(), and mspace_malloc().
|
static |
Definition at line 4120 of file mymalloc.cc.
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(), dlmalloc_trim(), mspace_free(), and mspace_trim().
|
static |
Definition at line 4188 of file mymalloc.cc.
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(), and mspace_malloc().
|
static |
Definition at line 4259 of file mymalloc.cc.
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(), and mspace_malloc().
|
static |
Definition at line 2498 of file mymalloc.cc.
|
static |
Definition at line 1496 of file mymalloc.cc.
|
static |
Definition at line 2490 of file mymalloc.cc.
Referenced by change_mparam(), create_mspace(), create_mspace_with_base(), dlpvalloc(), dlvalloc(), init_mparams(), init_top(), init_user_mstate(), mmap_resize(), sys_alloc(), and sys_trim().