Bitcoin full node and query server

Feb 26, 2025

View in context in the libbitcoin Slack #general mirror.

evoskuil04:28
The technique requires that the table head buckets are aligned, on 8 or 4 byte boundaries (rounded up link sizes). This is where the extra size comes from. I templatized the tables so that word alignment could be optionally enabled, and implemented the padding based on that. It doesn't affect link size (i.e. in the table bodies), just pads the head. The head cells must be atomically read/written, and ordered between write and read. This was previously achieved with a read-writer lock pattern using std::shared_mutex. This is still in place in the case where the template is not parameterized for alignment. This is done on the big hashmaps with low perf requirement (like address). The others are aligned and therefore use the memory fencing instead.