]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: pools: partially uninline pool_free()
authorWilly Tarreau <w@1wt.eu>
Mon, 24 Jan 2022 10:51:43 +0000 (11:51 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 24 Jan 2022 15:40:48 +0000 (16:40 +0100)
commit15c322c41362b3221c19202556b077d87ebd5080
tree2868dff32f955ce8f436e7fa754d547c4106ac01
parent7c564bfdd3498982b11669adbc4a99dcc04b5900
MINOR: pools: partially uninline pool_free()

The pool_free() function has become a bit big over time due to the
extra consistency checks. It used to remain inline only to deal
cleanly with the NULL pointer free that's quite present on some
structures (e.g. in stream_free()).

Here we're splitting the function in two:
  - __pool_free() does the inner block without the pointer test and
    becomes a function ;

  - pool_free() is now a macro that only checks the pointer and calls
    __pool_free() if needed.

The use of a macro versus an inline function is only motivated by an
easier intrumentation of the code later.

With this change, the code size reduces by ~1%, which means that at
this point all pool_free() call places used to represent more than
1% of the total code size.
include/haproxy/pool.h
src/pool.c