[patch v5] malloc: avoid need for tcache == NULL checks
Wilco Dijkstra
Wilco.Dijkstra@arm.com
Tue Oct 21 13:32:11 GMT 2025
Hi DJ,
> Avoid needing to check for tcache == NULL by initializing it
> to a dummy read-only tcache structure. This dummy is all zeros,
> so logically it is both full (when you want to put) and empty (when
> you want to get). Also, there are two dummies, one used for
> "not yet initialized" and one for "tunables say we shouldn't have
> a tcache".
LGTM.
Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Cheers,
Wilco
More information about the Libc-alpha
mailing list