From b74cf25fe44d56e87964a566a499303afa52dc9e Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Wed, 22 Jun 2011 17:44:50 +1200 Subject: [PATCH] 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. --- src/mem.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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); } -- 2.47.2