]> git.ipfire.org Git - thirdparty/haproxy.git/commit
OPTIM: log: use thread local lf_buildctx to stop pushing it on the stack
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 2 May 2024 13:30:17 +0000 (15:30 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 4 May 2024 08:13:05 +0000 (10:13 +0200)
commitccc4341258566cf5e6b26c612c3c88711f2a84f7
treefda0c3733751b23d56c6674b5aa90b01363ecac8
parent728b5aa835b40278f96a4330369bd6316fe51832
OPTIM: log: use thread local lf_buildctx to stop pushing it on the stack

Following previous commit's logic, let's move lf_buildctx ctx away from
sess_build_logline() to stop abusing from the stack to push large
structure each time sess_build_logline() is called. Also, don't memset
the structure for each invokation, but only reset members explicitly when
required.

For that we now declare one static lf_buildctx per thread (using
THREAD_LOCAL) and make sess_build_logline() refer to it using a pointer.
src/log.c