--------------------- PatchSet 3090 Date: 2001/10/02 22:40:47 Author: akroonmaa Branch: chunked_mempools Tag: (none) Log: tune malloc to use max of mmap. I resort here to dirty hack, because MMAP_MAX mallopt is not standard. I wonder if it makes sense to extract dlmalloc.h from dlmalloc.c Members: include/MemPool.h:1.1.2.15->1.1.2.16 lib/MemPool.c:1.1.2.20->1.1.2.21 Index: squid/include/MemPool.h =================================================================== RCS file: /cvsroot/squid-sf//squid/include/Attic/MemPool.h,v retrieving revision 1.1.2.15 retrieving revision 1.1.2.16 diff -u -r1.1.2.15 -r1.1.2.16 --- squid/include/MemPool.h 23 Aug 2001 18:55:10 -0000 1.1.2.15 +++ squid/include/MemPool.h 2 Oct 2001 22:40:47 -0000 1.1.2.16 @@ -13,10 +13,17 @@ #elif HAVE_MALLOC_H && !defined(_SQUID_FREEBSD_) && !defined(_SQUID_NEXT_) #include #endif + #if HAVE_MEMORY_H #include #endif +#if !M_MMAP_MAX +#if USE_DLMALLOC +#define M_MMAP_MAX -4 +#endif +#endif + #if PURIFY #define DISABLE_POOLS 1 /* Disabling Memory pools under purify */ #endif Index: squid/lib/MemPool.c =================================================================== RCS file: /cvsroot/squid-sf//squid/lib/Attic/MemPool.c,v retrieving revision 1.1.2.20 retrieving revision 1.1.2.21 diff -u -r1.1.2.20 -r1.1.2.21 --- squid/lib/MemPool.c 23 Aug 2001 18:55:11 -0000 1.1.2.20 +++ squid/lib/MemPool.c 2 Oct 2001 22:40:47 -0000 1.1.2.21 @@ -334,7 +334,7 @@ memset(&TheMeter, 0, sizeof(TheMeter)); mem_idle_limit = 2 * MB; mempool_initialised = 1; -#if HAVE_MALLOPT +#if HAVE_MALLOPT && M_MMAP_MAX mallopt(M_MMAP_MAX, MEM_MAX_MMAP_CHUNKS); #endif }