--------------------- PatchSet 11692 Date: 2007/09/23 07:33:37 Author: adrian Branch: HEAD Tag: (none) Log: Fully initialise mem_node's now that they may be allocated non-zero'ed. mem_node.uses wasn't being initialised and this would cause them to not be free()d. It also exposes a little interesting bug which shows the tracking of "cache_mem" can get out of sync with the actual allocation of stmem's as my squid showed a mem cache of 100k when 150meg of entries were in use. This may deserve some looking into at a later date. Members: src/stmem.c:1.72->1.73 Index: squid/src/stmem.c =================================================================== RCS file: /cvsroot/squid/squid/src/stmem.c,v retrieving revision 1.72 retrieving revision 1.73 diff -u -r1.72 -r1.73 --- squid/src/stmem.c 17 May 2005 16:56:38 -0000 1.72 +++ squid/src/stmem.c 23 Sep 2007 07:33:37 -0000 1.73 @@ -1,6 +1,6 @@ /* - * $Id: stmem.c,v 1.72 2005/05/17 16:56:38 hno Exp $ + * $Id: stmem.c,v 1.73 2007/09/23 07:33:37 adrian Exp $ * * DEBUG: section 19 Store Memory Primitives * AUTHOR: Harvest Derived @@ -116,9 +116,10 @@ } while (len > 0) { len_to_copy = XMIN(len, SM_PAGE_SIZE); - p = memAllocate(MEM_MEM_NODE); + p = memAllocate(MEM_MEM_NODE); /* This is a non-zero'ed buffer; make sure you fully initialise it */ p->next = NULL; p->len = len_to_copy; + p->uses = 0; store_mem_size += SM_PAGE_SIZE; xmemcpy(p->data, data, len_to_copy); if (!mem->head) {