/*
- * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
MemAllocator *
Mem::AllocatorProxy::getAllocator() const
{
- if (!theAllocator)
+ if (!theAllocator) {
theAllocator = MemPools::GetInstance().create(objectType(), size);
+ theAllocator->zeroBlocks(doZero);
+ }
return theAllocator;
}
if (!theAllocator)
return 0;
else
- return memPoolInUseCount(theAllocator);
+ return theAllocator->inUseCount();
+}
+
+void
+Mem::AllocatorProxy::zeroBlocks(bool doIt)
+{
+ getAllocator()->zeroBlocks(doIt);
}
MemPoolMeter const &
{
return getAllocator()->getStats(stats);
}
+