1#ifndef DinkyPool_Include_Guard
2#define DinkyPool_Include_Guard
19template<
unsigned int S>
28 if((8*count)+size <= S)
30 void* result=mBuf[count];
35 return ::operator
new(size);
40 if(ptr >= (
void*)mBuf[0] && ptr < (
void*)mBuf[(S+7)/8])
44 ::operator
delete(ptr);
49 return std::numeric_limits<size_t>::max();
62 char mBuf[(S+7)/8][8];
A dirt-simple lightweight pool allocator meant for use in short-lifetime objects.
size_t getPoolSizeBytes() const
size_t getPoolBytes() const
size_t getHeapBytes() const
void * allocate(size_t size)
void deallocate(void *ptr)
dcm! – add UnusedChecking(_enum) below;