[PATCH v3] malloc: send freed small chunks to smallbin

Wilco Dijkstra Wilco.Dijkstra@arm.com
Thu Oct 31 19:29:51 GMT 2024


Hi DJ,
 
>Florian Weimer <fweimer@redhat.com> writes:
>> I think adding a chunk to a smallbin does not bypass coalescing.  Adding
>> it to tcache or a fastbin does, but smallbins are handled by the lower
>> allocator.  Or do I misunderstand your concern?
>
> That's the point.  If we're putting chunks in the smallbin where
> previously we didn't (the unsorted bin is not coalesced) then those
> chunks are merged with adjacent chunks earlier than previously.  If this
> happens often enough, it could have a significant effect on RSS.

The insertion into unsorted/smallbin happens right after we have done 
consolidation with previous/next block. The unsorted bin is where all
the consolidation happens during a consolidation pass.

Cheers,
Wilco


More information about the Libc-alpha mailing list