MINOR: compiler: add new alignment macros
authorWilly Tarreau <w@1wt.eu>
Sat, 22 Feb 2020 14:51:39 +0000 (15:51 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 28 Feb 2020 10:11:57 +0000 (11:11 +0100)
commit8959ef33693442bfe9256e0c07a5768a86c4ab5d
treec2475f498293342e925f9c7d0a642bc065898489
parentf1b378487af3f22fd66b8013e52530c9a6c522de
MINOR: compiler: add new alignment macros

This commit adds ALWAYS_ALIGN(), MAYBE_ALIGN() and ATOMIC_ALIGN() to
be placed as delimitors inside structures to force alignment to a
given size. These depend on the architecture's capabilities so that
it is possible to always align, align only on archs not supporting
unaligned accesses at all, or only on those not supporting them for
atomic accesses (e.g. before a lock).

(cherry picked from commit 226ef26056d9e6151c9838e70a3e2f4db5068cd8)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
include/common/compiler.h