The USE_CHUNKEDMEMPOOLS build-time setting is not very useful and adds
extra complexity to the build system. Even when set it does not always
enable chunked pools. The environment variable MEMPOOLS can easily be
used to enable or disable chunked pools as needed.
Amos
=== modified file 'configure.ac'
--- configure.ac 2017-01-01 00:12:22 +0000
+++ configure.ac 2017-01-01 05:18:54 +0000
@@ -2630,20 +2630,6 @@
[Valgrind memory debugger support])
AC_MSG_NOTICE([Valgrind debug support enabled: $with_valgrind_debug])
-dnl Disable "memPools" code
-#AC_ARG_ENABLE(chunkedmempools,
-# AS_HELP_STRING([--enable-chunkedmempools],
-# [Enable experimental chunked memPools. Note that this option
-# simply sets the default behaviour. Specific classes can override this
-# at runtime, and only lib/MemPool.c needs to be altered
-# to change the squid-wide default for all classes.]), [
-#SQUID_YESNO([$enableval],
-# [--enable-chunkedmempools option takes no arguments])
-#])
-SQUID_DEFINE_BOOL(USE_CHUNKEDMEMPOOLS,${enable_chunkedmempools:=no},
- [Enable chunked Memory Pools support (experimental)])
-#AC_MSG_NOTICE([Chunked MemPools enabled: $enable_chunkedmempools])
-
dnl Enable WIN32 Service compile mode
AC_ARG_ENABLE(win32-service,
AS_HELP_STRING([--enable-win32-service],
=== modified file 'src/mem/Pool.cc'
--- src/mem/Pool.cc 2017-01-01 00:12:22 +0000
+++ src/mem/Pool.cc 2017-01-01 05:18:54 +0000
@@ -77,15 +77,13 @@
return mem_idle_limit;
}
-/* Change the default calue of defaultIsChunked to override
+/* Change the default value of defaultIsChunked to override
* all pools - including those used before main() starts where
* MemPools::GetInstance().setDefaultPoolChunking() can be called.
*/
-MemPools::MemPools() : pools(NULL), mem_idle_limit(2 << 20 /* 2 MB */),
- poolCount(0), defaultIsChunked(USE_CHUNKEDMEMPOOLS && !RUNNING_ON_VALGRIND)
+MemPools::MemPools()
{
- char *cfg = getenv("MEMPOOLS");
- if (cfg)
+ if (char *cfg = getenv("MEMPOOLS"))
defaultIsChunked = atoi(cfg);
}
=== modified file 'src/mem/Pool.h'
--- src/mem/Pool.h 2017-01-01 00:12:22 +0000
+++ src/mem/Pool.h 2017-01-01 05:18:54 +0000
@@ -29,7 +29,6 @@
*/
#include "mem/Meter.h"
-#include "splay.h"
#include "util.h"
#if HAVE_GNUMALLOC_H
@@ -165,10 +164,11 @@
void clean(time_t maxage);
void setDefaultPoolChunking(bool const &);
- MemImplementingAllocator *pools;
- ssize_t mem_idle_limit;
- int poolCount;
- bool defaultIsChunked;
+
+ MemImplementingAllocator *pools = nullptr;
+ ssize_t mem_idle_limit = (2 << 20) /* 2MB */;
+ int poolCount = 0;
+ bool defaultIsChunked = false;
};
/**
=== modified file 'src/mem/PoolChunked.h'
--- src/mem/PoolChunked.h 2017-01-01 00:12:22 +0000
+++ src/mem/PoolChunked.h 2017-01-01 05:18:54 +0000
@@ -10,6 +10,7 @@
#define _MEM_POOL_CHUNKED_H_
#include "mem/Pool.h"
+#include "splay.h"
#define MEM_CHUNK_SIZE 4 * 4096 /* 16KB ... 4 * VM_PAGE_SZ */
#define MEM_CHUNK_MAX_SIZE 256 * 1024 /* 2MB */
_______________________________________________
squid-dev mailing list
[email protected]
http://lists.squid-cache.org/listinfo/squid-dev