2 ms·
How can an allocator optimize the layout of a dynamically sized structure that's being changed without compacting? Now, compacting is an O(n) memory move plus
by AstralStorm 7y ago
How can an allocator optimize the layout of a dynamically sized structure that's being changed without compacting?
Now, compacting is an O(n) memory move plus additional calculation to figure out optimal-ish layout.
(Can be amortized, but it's same as amortizing hash table resizing. Optimal layout cannot be decided without profiling, and that's expensive.)