]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUILD: ebtree: improve architecture-specific alignment
authorWilly Tarreau <w@1wt.eu>
Sat, 22 Feb 2020 14:55:33 +0000 (15:55 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 25 Feb 2020 09:34:49 +0000 (10:34 +0100)
commit41136de58ef2a8f8fc1fa0f202a161eb7fe2c92d
tree27a96ef1464a335ae154b776562c8633b86a03b0
parent226ef26056d9e6151c9838e70a3e2f4db5068cd8
BUILD: ebtree: improve architecture-specific alignment

Commit 2c315ee75e ("BUG/MEDIUM: ebtree: don't set attribute packed
without unaligned access support") addressed alignment issues in
ebtrees in a way that is not really optimal since it will leave holes
in eb32trees for example.

This fix is better in that it restores the packed attribute on ebnode
but enforces proper alignment on the carrying nodes where necessary.
This also has the benefit of closing holes wherever possible and to
align data to the minimally required size.

The only thing it cannot close is the 32-bit hole at the end of ebmbnode
due to the required 64-bit on certain archs but at least it guarantees
that the key correctly points to the end of the node and that there is
never a hole after it.

This is a better fix than the one above and should be backported to
branches where the one above will be backported.
ebtree/eb32sctree.h
ebtree/eb32tree.h
ebtree/eb64tree.h
ebtree/ebmbtree.h
ebtree/ebpttree.h
ebtree/ebtree.h