From: Amos Jeffries Date: Wed, 22 Jun 2011 05:44:50 +0000 (+1200) Subject: Bug 3245: reconfigure: assertion failed: mem.cc:190: "MemPools[type] == NULL" X-Git-Tag: take08~55^2~110 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b74cf25fe44d56e87964a566a499303afa52dc9e;p=thirdparty%2Fsquid.git Bug 3245: reconfigure: assertion failed: mem.cc:190: "MemPools[type] == NULL" Make memDataInit() handle repeated calls. It still implicitly relies on Mem::Init() being called beforehand. --- diff --git a/src/mem.cc b/src/mem.cc index 4cf7a19346..9c83e637ff 100644 --- a/src/mem.cc +++ b/src/mem.cc @@ -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); }