]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: freq-ctr: use explicit-size types for freq-ctr struct
authorAurelien DARRAGON <adarragon@haproxy.com>
Wed, 22 Oct 2025 07:34:17 +0000 (09:34 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Wed, 22 Oct 2025 18:52:18 +0000 (20:52 +0200)
commit4693ee0ff7a5fa4a12ff69b1a33adca142e781ac
treeebd0b61ac795de5c7ec6eb0a4a692c418f87c510
parent466a603b59ed77e9787398ecf1baf77c46ae57b1
MEDIUM: freq-ctr: use explicit-size types for freq-ctr struct

freq-ctr struct is used by the shm_stats_file API, and more precisely,
it is used in the shm_stats_file_object struct for counters.

shm_stats_file_object struct requires to be plateform-independent, thus
we switch to using explicit size types (AKA fixed width integer types)
for freq-ctr, in the attempt to make freq-ctr size and memory mapping
consistent from one platform to another.

We cannot simply use fixed-width integer because some of them are
involved in atomic operations, and forcing a given width could
cause build issues on some platforms where atomic ops are not
implemented for large integers. Instead we leverage the FIXED_SIZE
macro to keep handling the integers as before, but forcing them to
be stored using expected number of bytes (unused bytes will simply
be ignored).

No change of behavior should be expected.
include/haproxy/freq_ctr-t.h