]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: pools: get rid of CONFIG_HAP_POOLS
authorWilly Tarreau <w@1wt.eu>
Thu, 8 Dec 2022 16:45:08 +0000 (17:45 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 8 Dec 2022 16:45:08 +0000 (17:45 +0100)
This one was set in defaults.h only when neither DEBUG_NO_POOLS nor
DEBUG_UAF were set. This was not the most convenient location to look
for it, and it was only used in pool.c to decide on the initial value
of POOL_DBG_NO_CACHE.

Let's just use DEBUG_NO_POOLS || DEBUG_UAF directly on this flag and
get rid of the intermediary condition. This also has the benefit of
removing a double inversion, which is always nice for understanding.

include/haproxy/defaults.h
src/pool.c

index 7b4992822e1a415f4c24bdeae5742b500791db9c..b1cfc7c1451850cd98642c7c676c810e29a741f9 100644 (file)
 #define DEFAULT_MAXZLIBMEM 0
 #endif
 
-/* Pools are always enabled unless explicitly disabled. When disabled, the
- * calls are directly passed to the underlying OS functions.
- */
-#if !defined(DEBUG_NO_POOLS) && !defined(DEBUG_UAF)
-#define CONFIG_HAP_POOLS
-#endif
-
 /* On modern architectures with many threads, a fast memory allocator, and
  * local pools, the global pools with their single list can be way slower than
  * the standard allocator which already has its own per-thread arenas. In this
index 8b3324759e680cd904ca589f2526e3c0984a8ef7..fd40cd87c0232febc8a5614fde7570fc636c7865 100644 (file)
@@ -52,7 +52,7 @@ uint pool_debugging __read_mostly =               /* set of POOL_DBG_* flags */
 #ifdef CONFIG_HAP_NO_GLOBAL_POOLS
        POOL_DBG_NO_GLOBAL  |
 #endif
-#ifndef CONFIG_HAP_POOLS
+#if defined(DEBUG_NO_POOLS) || defined(DEBUG_UAF)
        POOL_DBG_NO_CACHE   |
 #endif
 #if defined(DEBUG_POOL_TRACING)