Re:Memory – Part 4: Intersec’s custom allocators
by tomlu on Tuesday October 01, 2013 @09:19AM
(#6475872)
> 8-byte mallocs are expensive because most mallocs have per-allocation memory overhead to track things
As you say, most mallocs have this overhead. But with a bit of alignment trickery and bit masking you can put the header storage at the start of a page, bringing per-allocation overhead down to just a few bits.
As you say, most mallocs have this overhead. But with a bit of alignment trickery and bit masking you can put the header storage at the start of a page, bringing per-allocation overhead down to just a few bits.