]> git.ipfire.org Git - thirdparty/haproxy.git/commit
OPTIM: ebtree: pack the struct eb_node to avoid holes on 64-bit
authorWilly Tarreau <w@1wt.eu>
Sat, 7 Dec 2013 00:09:04 +0000 (01:09 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 7 Dec 2013 00:36:08 +0000 (01:36 +0100)
commitf82eb0283046db906dd5845cd6ee2a26bdc70314
treee623dca06def13aaffbedb6774cfd0cd64d8746b
parent37e340ce4bdcaa73d10d8f9d538ae02e29b40605
OPTIM: ebtree: pack the struct eb_node to avoid holes on 64-bit

struct eb_node is 36 bytes on a 64-bit machine. It's thus rounded
up to 40 bytes, and when forming a struct eb32_node, another 4 bytes
are added, rounded up to 48 bytes. We waste 8 bytes of space on 48
bytes because of alignments. It's basically the same with memory
blocks and immediate strings.

By packing the structure, eb32_node is down to 40 bytes. This saves
16 bytes per struct task and 20 bytes per struct stksess, used to
store each stick-table key.
ebtree/ebtree.h