by JoshMcguigan · 6y ago · 0 comments
As someone not very familiar with systems programming, I would have expected this is an optimization that would already happen automatically within the system memory allocator. Is that not the case?
So it sounds like it is not so much the allocation/de-allocation savings that matters, but rather that you get to skip initializing the memory because it is already known to be a valid instance of a given struct type?
See also SLAB allocation, used in many OS kernels: https://en.wikipedia.org/wiki/Slab_allocation