Comment by StilesCrisis
24 days ago
Don't worry, the allocator almost never dedicates actual heap space towards storing your allocation sizes. Instead, allocations get bucketed by size, and you can derive the size by working out which bucket the allocation is in. This is cheap and the bucketing is a good strategy anyway.
Unfortunately, "boundary tags" containing allocation size are still pretty common in dlmalloc-derived implementations like glibc, although slab allocators like you described are the preferred approach for most new implementations.