(no title)
raible | 3 years ago
Why bother? Because I can then easily add a few extra structs to the beginning of the (contiguously-allocated) linked-list without having to reallocate the whole thing.
Sure, pointer chasing with separately allocated structs is "slow", but I haven't yet measured to see if it's any different when (almost all) items are contiguous.
If you would... - what sort of cache behavior should one expect of this on a modern laptop CPU? - I haven't seen this approach before, have you?
Sirened|3 years ago
[1] https://www.prefetchers.info/augury.pdf
raible|3 years ago
It seems to me it's a super-handy way of "modifying" a compiler-allocated array of structs. I'm sticking with it!