mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-07 22:12:08 +00:00
BUILD: stick-tables: better mark the stktable_data as 32-bit aligned
Aurlien reported that clang's build was broken by the recent fix
845fb846c7
("BUG/MEDIUM: stick-tables: properly mark stktable_data
as packed"), because it now wants to use a helper for some atomic
ops (to increment std_t_uint). While this makes no sense to do
something that slow on modern architectures like x86 and arm64 which
are fine with unaligned accesses, we actually we can simply mark the
struct as aligned to its smallest element which is 32-bit (but still
packed). With this, it was verified that it is enough for clang to
see that its 32-bit operations will always be aligned, while making
64-bit operations safe on 64-bit platforms that do not support unaligned
accesses.
This should be backported wherever the patch above is backported.
This commit is contained in:
parent
0d35f8d918
commit
ea3b89952d
@ -119,7 +119,7 @@ union stktable_data {
|
||||
unsigned long long std_t_ull;
|
||||
struct freq_ctr std_t_frqp;
|
||||
struct dict_entry *std_t_dict;
|
||||
} __attribute__((packed));
|
||||
} __attribute__((packed, aligned(sizeof(int))));
|
||||
|
||||
/* known data types */
|
||||
struct stktable_data_type {
|
||||
|
Loading…
Reference in New Issue
Block a user