From: Amos Jeffries Date: Fri, 13 Jan 2017 05:14:03 +0000 (+1300) Subject: Remove USE_CHUNKEDMEMPOOLS compiler flag X-Git-Tag: M-staged-PR71~308 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2414910d19232460e3778e1b83e300553b631943;p=thirdparty%2Fsquid.git Remove USE_CHUNKEDMEMPOOLS compiler flag 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. --- diff --git a/configure.ac b/configure.ac index cb38b63628..fe917db6f2 100644 --- a/configure.ac +++ b/configure.ac @@ -2607,20 +2607,6 @@ SQUID_DEFINE_BOOL(WITH_VALGRIND,${with_valgrind_debug:=no}, [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], diff --git a/doc/release-notes/release-5.sgml b/doc/release-notes/release-5.sgml index a020b2e58d..ecdcb53ada 100644 --- a/doc/release-notes/release-5.sgml +++ b/doc/release-notes/release-5.sgml @@ -133,6 +133,10 @@ This section gives an account of those changes in three categories: --disable-inline

Removed. + -DUSE_CHUNKEDMEMPOOLS=1 +

Removed compiler flag. Use run-time environment variable MEMPOOLS=1 + to enable chunked memory pools instead. + diff --git a/src/mem/Pool.cc b/src/mem/Pool.cc index 77deb79586..270388f986 100644 --- a/src/mem/Pool.cc +++ b/src/mem/Pool.cc @@ -77,15 +77,13 @@ MemPools::idleLimit() const 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); } diff --git a/src/mem/Pool.h b/src/mem/Pool.h index 71790f72ec..7ca20924be 100644 --- a/src/mem/Pool.h +++ b/src/mem/Pool.h @@ -29,7 +29,6 @@ */ #include "mem/Meter.h" -#include "splay.h" #include "util.h" #if HAVE_GNUMALLOC_H @@ -165,10 +164,11 @@ public: 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; }; /** diff --git a/src/mem/PoolChunked.h b/src/mem/PoolChunked.h index 015817447d..5e42f5c2fd 100644 --- a/src/mem/PoolChunked.h +++ b/src/mem/PoolChunked.h @@ -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 */