]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: tools: add generic pointer hashing functions
authorWilly Tarreau <w@1wt.eu>
Wed, 7 Sep 2022 08:56:03 +0000 (10:56 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 8 Sep 2022 12:19:15 +0000 (14:19 +0200)
commit4a3907617f95f5d31e41978b7adf3ca42330ff5e
tree9c7b2f380fc6bcff2a4c5e182310ad1fe0078d12
parent6a28a30efaa8d6f6355cc4b1e9c8b5aeded661e4
MINOR: tools: add generic pointer hashing functions

There are a few places where it's convenient to hash a pointer to compute
a statistics bucket. Here we're basically reusing the hash that was used
by memory profiling with a minor update that the multiplier was corrected
to be prime and stand by its promise to have equal numbers of 1 and 0,
and that 32-bit platforms won't lose range anymore.

A two-pointer variant was also added.
include/haproxy/tools.h