[PATCH] malloc: Use correct C11 atomics for fastbin

DJ Delorie dj@redhat.com
Fri Dec 2 18:55:37 GMT 2022


Florian Weimer <fweimer@redhat.com> writes:
>> Wilco Dijkstra via Libc-alpha <libc-alpha@sourceware.org> writes:
>>> +/* Atomically pop from the fastbin list.  The arena lock must be held to
>>> +   block other threads removing entries, avoiding the ABA issue.  */
>>
>> If the arena lock must be held anyway, why go through the compare and
>> exchange overhead?  We know we're the only thread accessing it.
>
> Other threads are adding entries without the arena lock.

Ah.  That should be in the comment then.



More information about the Libc-alpha mailing list