20#define MEM_MAX_MMAP_CHUNKS 2048
21#define MEM_PAGE_SIZE 4096
22#define MEM_MIN_FREE 32
23#define MEM_MAX_FREE 65535
95 if (obj < chunk->objCache)
127 void **nextFree = (
void **)*Free;
142 Mem::Allocator(aLabel, aSize),
144 chunk_capacity(0), chunkCount(0), freeCache(nullptr), nextFreeChunk(nullptr),
149#if HAVE_MALLOPT && M_MMAP_MAX
233 if (chunk ==
nullptr) {
239 newChunk->
next = chunk;
243 while (chunk->
next) {
247 chunk->
next = newChunk;
253 chunk->
next = newChunk;
270 size_t csize = chunksize;
308 while ( (fchunk = chunk) !=
nullptr) {
364 MemChunk *chunk, *freechunk, *listTail;
378 while ((freechunk = chunk->
next) !=
nullptr) {
387 if (chunk->
next ==
nullptr)
401 while (chunk->
next) {
436 int chunks_partial = 0;
438 clean((time_t) 555555);
static int memCompChunks(MemChunk *const &, MemChunk *const &)
#define MEM_MAX_MMAP_CHUNKS
static int memCompObjChunks(void *const &, MemChunk *const &)
#define MEM_CHUNK_MAX_SIZE
MemChunk(MemPoolChunked *pool)
bool idleTrigger(int) const override
void convertFreeCacheToChunkFreeCache()
void * allocate() override
*alloc()
void deallocate(void *) override
freeOne(void *)
size_t getStats(Mem::PoolStats &) override
Splay< MemChunk * > allChunks
void setChunkSize(size_t) override
~MemPoolChunked() override
MemPoolChunked(const char *label, size_t obj_size)
void clean(time_t) override
const size_t objectSize
the size (in bytes) of objects managed by this allocator
int getInUseCount() const
the difference between the number of alloc() and freeOne() calls
const char * label
brief description of objects returned by alloc()
PoolMeter meter
statistics tracked for this allocator
size_t countSavedAllocs
the number of malloc()/calloc() calls avoided since last flush
ssize_t currentLevel() const
Value const * find(FindValue const &, int(*compare)(FindValue const &a, Value const &b)) const
void remove(Value const &, SPLAYCMP *compare)
const Value * insert(const Value &, SPLAYCMP *)
#define VALGRIND_MAKE_MEM_NOACCESS
#define VALGRIND_MAKE_MEM_DEFINED
void * xcalloc(size_t n, size_t sz)