diff --git a/include/common/config.h b/include/common/config.h index 9d7bf88e2..365705c4c 100644 --- a/include/common/config.h +++ b/include/common/config.h @@ -32,14 +32,4 @@ #define THREAD_LOCAL #endif -/* On architectures supporting threads and double-word CAS, we can implement - * lock-less memory pools. This isn't supported for debugging modes however. - */ -#if defined(USE_THREAD) && defined(HA_HAVE_CAS_DW) && !defined(DEBUG_NO_LOCKLESS_POOLS) && !defined(DEBUG_UAF) && !defined(DEBUG_FAIL_ALLOC) -#define CONFIG_HAP_LOCKLESS_POOLS -#ifndef CONFIG_HAP_POOL_CACHE_SIZE -#define CONFIG_HAP_POOL_CACHE_SIZE 524288 -#endif -#endif - #endif /* _COMMON_CONFIG_H */ diff --git a/include/common/defaults.h b/include/common/defaults.h index 335082518..aeddb0108 100644 --- a/include/common/defaults.h +++ b/include/common/defaults.h @@ -307,6 +307,11 @@ #define MEM_USABLE_RATIO 0.97 #endif +/* default per-thread pool cache size when enabled */ +#ifndef CONFIG_HAP_POOL_CACHE_SIZE +#define CONFIG_HAP_POOL_CACHE_SIZE 524288 +#endif + /* Number of samples used to compute the times reported in stats. A power of * two is highly recommended, and this value multiplied by the largest response * time must not overflow and unsigned int. See freq_ctr.h for more information. diff --git a/include/common/memory.h b/include/common/memory.h index 44a9dcb57..7bcef94ea 100644 --- a/include/common/memory.h +++ b/include/common/memory.h @@ -34,6 +34,13 @@ #include #include +/* On architectures supporting threads and double-word CAS, we can implement + * lock-less memory pools. This isn't supported for debugging modes however. + */ +#if defined(USE_THREAD) && defined(HA_HAVE_CAS_DW) && !defined(DEBUG_NO_LOCKLESS_POOLS) && !defined(DEBUG_UAF) && !defined(DEBUG_FAIL_ALLOC) +#define CONFIG_HAP_LOCKLESS_POOLS +#endif + #ifndef DEBUG_DONT_SHARE_POOLS #define MEM_F_SHARED 0x1 #else