about summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorRichard Earnshaw <rearnsha@arm.com>2020-12-21 15:03:03 +0000
committerRichard Earnshaw <rearnsha@arm.com>2020-12-21 15:25:25 +0000
commit3784dfc0985fc0185cdc79428f624cdd1e03eabf (patch)
tree3e06e7612d448775f531c6427d9f441462fc8c8e /include
parent26450d04d38c8ed7ce5f2c89114b18c5508f13f1 (diff)
downloadglibc-3784dfc0985fc0185cdc79428f624cdd1e03eabf.tar.gz
glibc-3784dfc0985fc0185cdc79428f624cdd1e03eabf.tar.xz
glibc-3784dfc0985fc0185cdc79428f624cdd1e03eabf.zip
malloc: Basic support for memory tagging in the malloc() family
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
available).

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

Reviewed-by: DJ Delorie <dj@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/malloc.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/malloc.h b/include/malloc.h
index 0765482c51..7ae08d53d3 100644
--- a/include/malloc.h
+++ b/include/malloc.h
@@ -15,4 +15,12 @@ struct malloc_state;
 typedef struct malloc_state *mstate;
 
 # endif /* !_ISOMAC */
+
+#ifdef USE_MTAG
+extern int __mtag_mmap_flags;
+#define MTAG_MMAP_FLAGS __mtag_mmap_flags
+#else
+#define MTAG_MMAP_FLAGS 0
+#endif
+
 #endif