Allocator.h
Go to the documentation of this file.
93 static size_t RoundedSize(const size_t minSize) { return ((minSize + sizeof(void*) - 1) / sizeof(void*)) * sizeof(void*); }
Definition: Allocator.h:22
const size_t objectSize
the size (in bytes) of objects managed by this allocator
Definition: Allocator.h:112
static size_t RoundedSize(const size_t minSize)
Definition: Allocator.h:93
static const size_t FlushLimit
Flush counters to 'meter' after flush limit allocations.
Definition: Allocator.h:25
size_t countFreeOne
the number of calls to Mem::Allocator::freeOne() since last flush
Definition: Allocator.h:104
int getInUseCount() const
the difference between the number of alloc() and freeOne() calls
Definition: Allocator.h:59
virtual size_t getStats(PoolStats &)=0
virtual void setChunkSize(size_t)
XXX: Misplaced – not all allocators have a notion of a "chunk". See MemPoolChunked.
Definition: Allocator.h:65
Allocator(const char *const aLabel, const size_t sz)
Definition: Allocator.h:27
virtual void clean(time_t maxage)=0
virtual bool idleTrigger(int shift) const =0
void * alloc()
provide (and reserve) memory suitable for storing one object
Definition: Allocator.h:44
size_t countAlloc
the number of calls to Mem::Allocator::alloc() since last flush
Definition: Allocator.h:98
size_t countSavedAllocs
the number of malloc()/calloc() calls avoided since last flush
Definition: Allocator.h:101
void update(size_t items, size_t itemSize)
account for memory actions taking place
Definition: Meter.h:68
Definition: Meter.h:55
Definition: Stats.h:18
convenience base for any class with pure virtual method(s)
Definition: TypeTraits.h:19