[PATCH] malloc: retire mechanism for older non used tcached chunks

Florian Weimer fweimer@redhat.com
Thu Nov 13 16:24:54 GMT 2025


* Cupertino Miranda:

>> I don't know if I understand what you mean. It always does it in that
>> loop, right? The loop traverses the bin freeing all those chunks.
>> One mistake I notice there is the call to __libc_free, instead of
>> _int_free_chunk, locking the arena only once instead of for each
>> chunk.  Will fix it for v2.

> Just realize that it would only make sense if there is a single arena.

You can do a loop and switch locks if the arena changes, like I did in
this prototype patch:

<https://inbox.sourceware.org/libc-alpha/lhuqzuaxijn.fsf@oldenburg.str.redhat.com/>

Thanks,
Florian



More information about the Libc-alpha mailing list