Go to the documentation of this file.
9 #ifndef _SQUID_SRC_MEM_ALLOCATORPROXY_H
10 #define _SQUID_SRC_MEM_ALLOCATORPROXY_H
26 #define MEMPROXY_CLASS(CLASS) \
28 static inline Mem::AllocatorProxy &Pool() { \
29 static Mem::AllocatorProxy thePool(#CLASS, sizeof(CLASS), false); \
33 void *operator new(size_t byteCount) { \
35 assert(byteCount == sizeof(CLASS)); \
36 return Pool().alloc(); \
38 void operator delete(void *address) { \
40 Pool().freeOne(address); \
42 static int UseCount() { return Pool().inUseCount(); } \
54 AllocatorProxy(
char const *aLabel,
size_t const &aSize,
bool doZeroBlocks =
true):
void freeOne(void *)
Free a element allocated by Mem::AllocatorProxy::alloc()
class Ping::pingStats_ stats
int getStats(MemPoolStats *stats)
void * alloc()
Allocate one element from the pool.
MemAllocator * theAllocator
char const * objectType() const
size_t objectSize() const
AllocatorProxy(char const *aLabel, size_t const &aSize, bool doZeroBlocks=true)
void zeroBlocks(bool doIt)
MemAllocator * getAllocator() const
MemPoolMeter const & getMeter() const