]> git.kaiwu.me - haproxy.git/commit
IMPORT: slz: get rid of the bogus USE_64BIT_QUEUE and check siezof(long) instead
authorWilly Tarreau <w@1wt.eu>
Mon, 31 Aug 2026 12:14:16 +0000 (14:14 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Tue, 1 Sep 2026 11:47:07 +0000 (13:47 +0200)
commit818cd155e990042e19a4c63f39923f1661ffdc3c
tree4ed9f1a7e42577a59bdca8ba72549eed9eed97cc
parente0fe1be1c8edb381f99aa221d839cf22730f1422
IMPORT: slz: get rid of the bogus USE_64BIT_QUEUE and check siezof(long) instead

The USE_64BIT_QUEUE was set when it was suggested to rely on 64-bit
operations on the queue and dump 32 bits at once (thus never keeping
more than 32 bits in the queue). It was also used to decide whether
the queue was stored as u32 or u64. However, this check in the public
part (slz.h) depends on a definition in the private part (slz-prv.h)
that cannot be seen by application code. Luckily, slz.c includes its
headers in the wrong order so it gets the public part before the private
one, and uses the same layout, which is why it was not detected earlier.

Let's just get rid of this USE_64BIT_QUEUE definition. It's not accurate
and cannot be matched between public and private code. Let's instead rely
on __SIZEOF_LONG__ which conveys the info we need: is the CPU efficient
when working on 64-bit integers.

The comments were adjusted to explain the difference and why it's not
dramatic to fall back to the 32-bit queue (in effect it's around a 1%
perf loss).

This must be backported to 1.3.

This is libslz upstream commit 54cf477a1736b3e747af14ce1ec38d7c28b34cfc
include/import/slz-prv.h
include/import/slz.h
src/slz.c