]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: compiler: add a new "ASSUME" macro to help the compiler
authorWilly Tarreau <w@1wt.eu>
Thu, 7 Nov 2024 10:09:33 +0000 (11:09 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 17 Dec 2024 15:46:46 +0000 (16:46 +0100)
commitefc897484b8b875f908c144d82313923be8c3392
treed62256c50f1d5eed3fb89e6acfdfc4c314b2d756
parent41fc18b1d1a37e2a6645ea4a8fb4d2d5f009fc0c
MINOR: compiler: add a new "ASSUME" macro to help the compiler

This macro takes an expression, tests it and calls an unreachable
statement if false. This allows the compiler to know that such a
combination does not happen, and totally eliminate tests that would
be related to this condition. When the statement is not available
in the compiler, we just perform a break from a do {} while loop
so that the expression remains evaluated if needed (e.g. function
call).
include/haproxy/compiler.h