From: hno <> Date: Tue, 16 Apr 2002 06:33:29 +0000 (+0000) Subject: Clear all pools on free. Don't assume pools having an even size (in KB) is X-Git-Tag: SQUID_3_0_PRE1~1066 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a719c932a227da8cbafc0af24a2b37814eb99e88;p=thirdparty%2Fsquid.git Clear all pools on free. Don't assume pools having an even size (in KB) is plain buffers. --- diff --git a/lib/MemPool.c b/lib/MemPool.c index a58c8bd134..f2e5d74eb0 100644 --- a/lib/MemPool.c +++ b/lib/MemPool.c @@ -1,6 +1,6 @@ /* - * $Id: MemPool.c,v 1.10 2002/04/08 10:17:11 hno Exp $ + * $Id: MemPool.c,v 1.11 2002/04/16 00:33:29 hno Exp $ * * DEBUG: section 63 Low Level Memory Pool Management * AUTHOR: Alex Rousskov, Andres Kroonmaa @@ -249,7 +249,11 @@ static void memPoolPush(MemPool * pool, void *obj) { void **Free; - if ((pool->obj_size % 2048) != 0) + /* XXX We should figure out a sane way of avoiding having to clear + * all buffers. For example data buffers such as used by MemBuf do + * not really need to be cleared.. There was a condition based on + * the object size here, but such condition is not safe. + */ memset(obj, 0, pool->obj_size); Free = obj; *Free = pool->freeCache;