Re:Arena Allocator Tips and Tricks
by danhau on Wednesday September 27, 2023 @11:01AM
(#37675627)
std::vector is fine if you access elements by index, instead of pointer, which can be a perfectly fine approach. Of course this kills the general purpose allocator aspect, since you're not getting back pointers, only offsets.
However, if you combine that with generation numbers, you can make yourself a very handy container with stable and safe references. slotmap [1] comes to mind.
However, if you combine that with generation numbers, you can make yourself a very handy container with stable and safe references. slotmap [1] comes to mind.
[1]: https://docs.rs/slotmap/latest/slotmap/