]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Remove USE_CHUNKEDMEMPOOLS compiler flag
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 13 Jan 2017 05:14:03 +0000 (18:14 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 13 Jan 2017 05:14:03 +0000 (18:14 +1300)
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.

configure.ac
doc/release-notes/release-5.sgml
src/mem/Pool.cc
src/mem/Pool.h
src/mem/PoolChunked.h

index cb38b636286568e772d395447e092a71d1b1fe89..fe917db6f21282679cb511b6297c7cae1e77ead4 100644 (file)
@@ -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],
index a020b2e58d195f31c6c5cbd2af4059f3152eca0a..ecdcb53ada2cdedbf5513b19ef42f8fb5851de3f 100644 (file)
@@ -133,6 +133,10 @@ This section gives an account of those changes in three categories:
        <tag>--disable-inline</tag>
        <p>Removed.
 
+       <tag>-DUSE_CHUNKEDMEMPOOLS=1</tag>
+       <p>Removed compiler flag. Use run-time environment variable <em>MEMPOOLS=1</em>
+          to enable chunked memory pools instead.
+
 </descrip>
 
 
index 77deb7958625e5f4c898c8b9c1e4610698d6af36..270388f986e46e58982cfd1c30db54742266bc92 100644 (file)
@@ -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);
 }
 
index 71790f72ecda579881725bd1177fc695f3c6a5aa..7ca20924becd434c77b72dd87c7c43e49642d59f 100644 (file)
@@ -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;
 };
 
 /**
index 015817447db983419ae14b9bc1d8b51830677d4a..5e42f5c2fd8dc468bc03cb2bf5977223aef47336 100644 (file)
@@ -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 */