[PATCH 3/7] malloc: Basic support for memory tagging in the malloc() family

Richard Earnshaw rearnsha@arm.com
Mon Jun 15 14:40:25 GMT 2020

This patch adds the basic support for memory tagging.

Various flavours are supported, particularly being able to turn on
tagged memory at run-time: this allows the same code to be used on
systems where memory tagging support is not present without neededing
a separate build of glibc.  Also, depending on whether the kernel
supports it, the code will use mmap for the default arena if morecore
does not, or cannot support tagged memory (on AArch64 it is not

All the hooks use function pointers to allow this to work without
needing ifuncs.

malloc: allow memory tagging to be controlled from a tunable
 malloc/arena.c              |  42 ++++++++-
 malloc/malloc.c             | 171 ++++++++++++++++++++++++++++--------
 malloc/malloc.h             |   7 ++
 sysdeps/generic/libc-mtag.h |  52 +++++++++++
 4 files changed, 233 insertions(+), 39 deletions(-)
 create mode 100644 sysdeps/generic/libc-mtag.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-malloc-Basic-support-for-memory-tagging-in-the-mallo.patch
Type: text/x-patch
Size: 21753 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20200615/c8dc3733/attachment-0001.bin>

More information about the Libc-alpha mailing list