[PATCH v2 1/3] malloc: Add sysdep hooks for request and usable sizes

Wilco Dijkstra Wilco.Dijkstra@arm.com
Wed Sep 30 18:40:01 GMT 2026


Hi Muhammad,

+#ifndef SYSDEP_EXTRA_HEADER_SIZE
+#define SYSDEP_EXTRA_HEADER_SIZE 0
+#endif

I would use a single define that is either SIZE_SZ (by default) or CHUNK_HDR_SIZE (for MTE)
and then use that in checked_request2size and chunksize2usable. Not sure what would be a
good name, perhaps CHUNK_OVERHEAD?

Also tidx2usize() will need adjusting. And clear_memory hardcodes the overhead and clears
an odd multiple of SIZE_SZ which is incorrect with MTE. It's worth checking the other uses of
SIZE_SZ too. There are a few incorrect uses of CHUNK_HDR_SIZE (one of which will be fixed by
Sam's mmap fix).

Cheers,
Wilco


More information about the Libc-alpha mailing list