]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/mem/AllocatorProxy.cc
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / mem / AllocatorProxy.cc
index c9128cfc58b03722936d374efb4eb36808da3ed1..12733f63e1caf6cf520f0bdf444d3faecc54e191 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -28,8 +28,10 @@ Mem::AllocatorProxy::freeOne(void *address)
 MemAllocator *
 Mem::AllocatorProxy::getAllocator() const
 {
-    if (!theAllocator)
+    if (!theAllocator) {
         theAllocator = MemPools::GetInstance().create(objectType(), size);
+        theAllocator->zeroBlocks(doZero);
+    }
     return theAllocator;
 }
 
@@ -39,7 +41,13 @@ Mem::AllocatorProxy::inUseCount() const
     if (!theAllocator)
         return 0;
     else
-        return memPoolInUseCount(theAllocator);
+        return theAllocator->inUseCount();
+}
+
+void
+Mem::AllocatorProxy::zeroBlocks(bool doIt)
+{
+    getAllocator()->zeroBlocks(doIt);
 }
 
 MemPoolMeter const &
@@ -53,3 +61,4 @@ Mem::AllocatorProxy::getStats(MemPoolStats * stats)
 {
     return getAllocator()->getStats(stats);
 }
+