[PATCH v7 1/2] malloc: add tcache support for large chunk caching

Wilco Dijkstra Wilco.Dijkstra@arm.com
Tue May 27 23:27:06 GMT 2025


Hi Cupertino,

Another thing, 64-bit targets may malloc over 4GB, so this will fail:

>> +              - __builtin_clz (nb);

You need to ensure it works for 32-bit and 64-bit size_t - clzl won't work
since unsigned long is not always the same size as size_t, and while clzll
should work, it has to be efficient on 32-bit targets (ie. not becoming a
call when clz isn't a call). The new stdbit.h is type generic, so could be
used, but we need to confirm that it results in good code.

Cheers,
Wilco


More information about the Libc-alpha mailing list