[PATCH v3] malloc: Use C11 atomics on memusage

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Mon Apr 3 13:35:17 GMT 2023



On 03/04/23 10:10, Wilco Dijkstra wrote:
> Hi,
> 
>> Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:
>>> -#include <atomic.h>
> 
> Just double checking, does this mean we are now happy with bypassing
> the internal header, all its defines/checks and target implementations,
> and require that all supported targets have correctly implemented C11
> atomics?

I did it for memusage mainly because it is standalone library that in
theory can be move out glibc (and I might do it, similar to what I did
for libSegfault).

> 
> This would make my outstanding patches on cleaning up atomics a lot
> easier, however I'm wondering whether this will "just work" given the
> intermediate state will be a mix between C11 atomics and various target
> specific hacks. My patches tried hard to avoid such issues by taking
> tiny steps in improving this and keeping everything consistent.

I think for internal usage, we might still use the internal atomic.h. 
Maybe what we can do it to fist move all the internal code to the
C11-like interface and then check if we can move to compiler builtins.


More information about the Libc-alpha mailing list