[PATCH] malloc: Count tcache entries downwards
Cupertino Miranda
cupertino.miranda@oracle.com
Wed May 7 13:37:27 GMT 2025
On 07-05-2025 13:42, Wilco Dijkstra wrote:
> Hi Cupertino,
>
>> I wonder if we do not have a race around mallopt already.
>> First look at the do_set_... functions seem to change shared variables
>> not really taking any consideration for concurrent accesses.
>
> We do indeed. It's probably not a huge issue that there is no use of
> atomics (only a few older targets will have issues), however none of the
> code was designed with concurrent changes of the globals in mind.
> So the same global can change when you read it multiple times,
> and you have to somehow deal with that correctly...
Right! Some weird side effects could happen in those cases.
>
> Cheers,
> Wilco
More information about the Libc-alpha
mailing list