]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: pools: move default settings to defaults.h
authorWilly Tarreau <w@1wt.eu>
Mon, 27 Sep 2021 17:29:30 +0000 (19:29 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 28 Sep 2021 17:31:16 +0000 (19:31 +0200)
There's no reason CONFIG_HAP_POOLS and its opposite are located into
pools-t.h, it forces those that depend on them to inlcude the file.
Other similar options are normally dealt with in defaults.h, which is
part of the default API, so let's do that.

include/haproxy/defaults.h
include/haproxy/pool-t.h
include/haproxy/tinfo-t.h

index 19a9cb62358b45743b67e16c544390ca81c50146..7547a17dac7229e955d1aedb5fdb28e70d816b27 100644 (file)
 #define MEM_USABLE_RATIO 0.97
 #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) && !defined(DEBUG_FAIL_ALLOC)
+#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
+ * case we disable global pools. The global pools may still be enforced
+ * using CONFIG_HAP_GLOBAL_POOLS though.
+ */
+#if defined(USE_THREAD) && defined(HA_HAVE_FAST_MALLOC) && !defined(CONFIG_HAP_GLOBAL_POOLS)
+#define CONFIG_HAP_NO_GLOBAL_POOLS
+#endif
+
 /* default per-thread pool cache size when enabled */
 #ifndef CONFIG_HAP_POOL_CACHE_SIZE
 #define CONFIG_HAP_POOL_CACHE_SIZE 1048576
index a1aba4aa0d5df14449c73ff263ba4e8691de8ccc..c33ffc7f1b32f75747f9e9e1ee13bd37e4985817 100644 (file)
 #include <haproxy/list-t.h>
 #include <haproxy/thread-t.h>
 
-/* 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) && !defined(DEBUG_FAIL_ALLOC)
-#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
- * case we disable global pools. The global pools may still be enforced
- * using CONFIG_HAP_GLOBAL_POOLS though.
- */
-#if defined(USE_THREAD) && defined(HA_HAVE_FAST_MALLOC) && !defined(CONFIG_HAP_GLOBAL_POOLS)
-#define CONFIG_HAP_NO_GLOBAL_POOLS
-#endif
-
 #define MEM_F_SHARED   0x1
 #define MEM_F_EXACT    0x2
 
index 1285c731a09ca712f0a7450d7671592a3c9f2942..4ed042f7237b6a8c710c1c434efc19c479c9d71b 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <time.h>
 #include <haproxy/api-t.h>
-#include <haproxy/pool-t.h>
 
 /* thread info flags, for ha_thread_info[].flags */
 #define TI_FL_STUCK             0x00000001