dysfun@treehouse.systems ("gaytabase") wrote:
my nodes have a tightly packed structure to keep the size down. and part of the node is aligned to a cacheline. except the metadata that should go before it is variably sized. the metadata before it is needed to know the size of the various things in the node.
the metadata that should go after it can be split to fill the hole but this is quite tedious.
but there's nothing to say that a pointer has to point to the start of a region of memory, right? it could just point within it. they're not even real pointers, they're offsets within the file. it makes accounting a little more tedious, but we can trivially achieve optimal packing always by simply adding some small integers to the fixed size 'header' (which could be in the middle, immediately after the simd data.)