]> git.ipfire.org Git - thirdparty/haproxy.git/commit
DEBUG: add BUG_ON_STRESS(): a BUG_ON() implemented only when DEBUG_STRESS > 0
authorWilly Tarreau <w@1wt.eu>
Fri, 14 Nov 2025 15:25:27 +0000 (16:25 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 14 Nov 2025 15:42:53 +0000 (16:42 +0100)
commit675c86c4aa29410de806dcfe7abe099dc541be03
tree747cbb55238562eaf3f552d034bf7a0203523f38
parent3d441e78e50f6de953c5656a5c8e443b7bc2f16e
DEBUG: add BUG_ON_STRESS(): a BUG_ON() implemented only when DEBUG_STRESS > 0

The purpose of this new BUG_ON is beyond BUG_ON_HOT(). While BUG_ON_HOT()
is meant to be light but placed on very hot code paths, BUG_ON_STRESS()
might be heavy and only used under stress-testing, to try to detect early
that something bad is starting to happen. This one is not even type-checked
when not defined because we don't want to risk the compiler emitting the
slightest piece of code there in production mode, so as to give enough
freedom to the developers.
include/haproxy/bug.h