]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: pools: switch the fail-alloc test to runtime only
authorWilly Tarreau <w@1wt.eu>
Mon, 21 Feb 2022 16:16:22 +0000 (17:16 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 23 Feb 2022 16:11:33 +0000 (17:11 +0100)
commit8d0273ed88ceac6d02bc30234d07dd77dee89b11
tree649e41ed1f2e834d82ee740d7057104cb206a6a5
parent605629b0085253d6608d8d43d2fa8d2e1fb127b2
MINOR: pools: switch the fail-alloc test to runtime only

The fail-alloc test used to be enabled/disabled at build time using
the DEBUG_FAIL_ALLOC macro, but it happens that the cost of the test
is quite cheap and that it can be enabled as one of the pool_debugging
options.

This patch thus introduces the first POOL_DBG_FAIL_ALLOC option, whose
default value depends on DEBUG_FAIL_ALLOC. The mem_should_fail() function
is now always built, but it was made static since it's never used outside.
include/haproxy/pool-t.h
include/haproxy/pool.h
src/pool.c