9#ifndef _SQUID_SRC_MEM_ALLOCATORPROXY_H
10#define _SQUID_SRC_MEM_ALLOCATORPROXY_H
28#define MEMPROXY_CLASS(CLASS) \
30 static inline Mem::AllocatorProxy &Pool() { \
31 static Mem::AllocatorProxy thePool(#CLASS, sizeof(CLASS), false); \
35 void *operator new(size_t byteCount) { \
37 assert(byteCount == sizeof(CLASS)); \
38 return Pool().alloc(); \
40 void operator delete(void *address) { \
42 Pool().freeOne(address); \
44 static int UseCount() { return Pool().inUseCount(); } \
58 AllocatorProxy(
char const *aLabel,
size_t const &aSize,
bool doZeroBlocks =
true):
86 void relabel(
const char *
const aLabel);
void * alloc()
Allocate one element from the pool.
void relabel(const char *const aLabel)
void freeOne(void *)
Free a element allocated by Mem::AllocatorProxy::alloc()
Allocator * getAllocator() const
void zeroBlocks(bool doIt)
AllocatorProxy(char const *aLabel, size_t const &aSize, bool doZeroBlocks=true)
char const * objectType() const
size_t getStats(PoolStats &stats)
size_t objectSize() const
PoolMeter const & getMeter() const
class Ping::pingStats_ stats