]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3245: reconfigure: assertion failed: mem.cc:190: "MemPools[type] == NULL"
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 22 Jun 2011 05:44:50 +0000 (17:44 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 22 Jun 2011 05:44:50 +0000 (17:44 +1200)
Make memDataInit() handle repeated calls.

It still implicitly relies on Mem::Init() being called beforehand.

src/mem.cc

index 4cf7a19346c9608c37daa0535daea2458a91001d..9c83e637ffb65cbe3f7843bb24c01a93129de5c0 100644 (file)
@@ -180,14 +180,19 @@ Mem::Stats(StoreEntry * sentry)
  */
 
 /*
- * we have a limit on _total_ amount of idle memory so we ignore
- * max_pages for now
+ * we have a limit on _total_ amount of idle memory so we ignore max_pages for now.
+ * Will ignore repeated calls for the same pool type.
+ *
+ * Relies on Mem::Init() having been called beforehand.
  */
 void
 memDataInit(mem_type type, const char *name, size_t size, int max_pages_notused, bool zeroOnPush)
 {
     assert(name && size);
-    assert(MemPools[type] == NULL);
+
+    if (MemPools[type] != NULL)
+        return;
+
     MemPools[type] = memPoolCreate(name, size);
     MemPools[type]->zeroOnPush(zeroOnPush);
 }