[patch v2] malloc: avoid need for tcache == NULL checks
Florian Weimer
fweimer@redhat.com
Mon Sep 1 13:41:20 GMT 2025
* Wilco Dijkstra:
> Hi DJ,
>
>>> I suppose these could be inline functions instead of macros.
>>
>> That's been suggested in the past, and IIRC my reply was "why?"
>> Changing these to functions just makes the file longer, it doesn't
>> change the generated code. And, I like having all the related macros
>> together like that instead of spread across multiple pages.
>
> The main advantage is that one can add checks in inline functions or make
> changes without ending up with complex multi-line macros.
It also makes it clear there is funny control flow, or access to local
variables. Some of the existing malloc-internal macros are like that.
Thanks,
Florian
More information about the Libc-alpha
mailing list