From: Francesco Chemolli Date: Wed, 14 Apr 2010 21:04:28 +0000 (+0200) Subject: changed mempools option handling X-Git-Tag: SQUID_3_2_0_1~271^2~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fbc04c0a175b5c68c1ef087faf8275cd86bbe3c2;p=thirdparty%2Fsquid.git changed mempools option handling simplified default value handling for some options --- diff --git a/configure.in b/configure.in index dad2cac7e7..a798aedd92 100644 --- a/configure.in +++ b/configure.in @@ -2001,26 +2001,19 @@ AC_ARG_WITH(valgrind-debug, ]) dnl Disable "memPools" code -squid_opt_enable_mempools=yes #default AC_ARG_ENABLE(mempools, AS_HELP_STRING([--disable-mempools], [Disable memPools. Note that this option now 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([$squid_opt_enable_mempools], +SQUID_YESNO([$enableval], [--disable-mempools option takes no arguments]) -squid_opt_enable_mempools=$enableval ]) -# transform positive to negative value. -AC_MSG_NOTICE([MemPools enabled: $squid_opt_enable_mempools]) -if test "$squid_opt_enable_mempools" = "yes" ; then - squid_opt_enable_mempools=no -else - squid_opt_enable_mempools=yes -fi -SQUID_DEFINE_UNQUOTED(DISABLE_POOLS,$squid_opt_enable_mempools, +# notice: the definition's value meaning is INVERTED +SQUID_DEFINE_UNQUOTED(USE_MEMPOOLS,${enable_mempools:=yes}, [Disable Memory Pools support and fall back to system malloc]) +AC_MSG_NOTICE([MemPools enabled: $enable_mempools]) dnl Enable WIN32 Service compile mode AC_ARG_ENABLE(win32-service, @@ -2053,17 +2046,15 @@ if test "$squid_require_sasl" = "yes"; then fi # Disable "unlinkd" code -squid_opt_enable_unlinkd=yes AC_ARG_ENABLE(unlinkd, AS_HELP_STRING([--disable-unlinkd],[Do not use unlinkd]), [ SQUID_YESNO([$enableval], [unrecognized argument to --disable-unlinkd: $enableval]) -squid_opt_enable_unlinkd=$enableval ]) -AC_MSG_NOTICE([unlinkd enabled: $squid_opt_enable_unlinkd]) -SQUID_DEFINE_UNQUOTED([USE_UNLINKD],$squid_opt_enable_unlinkd, +SQUID_DEFINE_UNQUOTED([USE_UNLINKD],${enable_unlinkd:=yes}, [Enable useage of unlinkd]) -AM_CONDITIONAL(ENABLE_UNLINKD,test "$squid_opt_enable_unlinkd" = "yes") +AM_CONDITIONAL(ENABLE_UNLINKD,test "$enable_unlinkd" = "yes") +AC_MSG_NOTICE([unlinkd enabled: $enable_unlinkd]) # Enable backtraces on fatal errors AC_ARG_ENABLE(stacktraces, diff --git a/lib/MemPool.cc b/lib/MemPool.cc index c09b897633..3266bae805 100644 --- a/lib/MemPool.cc +++ b/lib/MemPool.cc @@ -359,7 +359,7 @@ MemPool::createChunk() * MemPools::GetInstance().setDefaultPoolChunking() can be called. */ MemPools::MemPools() : pools(NULL), mem_idle_limit(2 * MB), - poolCount (0), defaultIsChunked (!DISABLE_POOLS && !RUNNING_ON_VALGRIND) + poolCount (0), defaultIsChunked (USE_MEMPOOLS && !RUNNING_ON_VALGRIND) { char *cfg = getenv("MEMPOOLS"); if (cfg) diff --git a/test-suite/MemPoolTest.cc b/test-suite/MemPoolTest.cc index f44177e305..1ce1e934f5 100644 --- a/test-suite/MemPoolTest.cc +++ b/test-suite/MemPoolTest.cc @@ -34,7 +34,7 @@ #include "squid.h" -#if !DISABLE_POOLS +#if USE_MEMPOOLS #include "MemPool.h" @@ -82,12 +82,12 @@ MemPoolTest::run() delete Pool; } -#endif /* DISABLE_POOLS */ +#endif /* USE_MEMPOOLS */ int main (int argc, char **argv) { -#if !DISABLE_POOLS +#if USE_MEMPOOLS MemPoolTest aTest; aTest.run(); #endif