1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-10 05:03:06 +03:00

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>
This commit is contained in:
Richard Earnshaw
2020-12-21 15:03:03 +00:00
parent 26450d04d3
commit 3784dfc098
5 changed files with 437 additions and 97 deletions

View File

@@ -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