diff mbox series

[03/16] malloc: Move MTAG_MMAP_FLAGS definition

Message ID f7cd6d47a7d32cb818e711f24e21f75b6e0231f1.1614874816.git.szabolcs.nagy@arm.com
State New
Headers show
Series memory tagging improvements | expand

Commit Message

Szabolcs Nagy March 4, 2021, 4:31 p.m. UTC
This is only used internally in malloc.c, the extern declaration
was wrong, __mtag_mmap_flags has internal linkage.
---
 include/malloc.h | 7 -------
 malloc/malloc.c  | 2 ++
 2 files changed, 2 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/include/malloc.h b/include/malloc.h
index 7ae08d53d3..b77761f74d 100644
--- a/include/malloc.h
+++ b/include/malloc.h
@@ -16,11 +16,4 @@  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
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 10ea6aa441..4538a01614 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -463,11 +463,13 @@  static void *(*__tag_region)(void *, size_t) = __default_tag_region;
 static void *(*__tag_new_usable)(void *) = __default_tag_nop;
 static void *(*__tag_at)(void *) = __default_tag_nop;
 
+# define MTAG_MMAP_FLAGS __mtag_mmap_flags
 # define TAG_NEW_MEMSET(ptr, val, size) __tag_new_memset (ptr, val, size)
 # define TAG_REGION(ptr, size) __tag_region (ptr, size)
 # define TAG_NEW_USABLE(ptr) __tag_new_usable (ptr)
 # define TAG_AT(ptr) __tag_at (ptr)
 #else
+# define MTAG_MMAP_FLAGS 0
 # define TAG_NEW_MEMSET(ptr, val, size) memset (ptr, val, size)
 # define TAG_REGION(ptr, size) (ptr)
 # define TAG_NEW_USABLE(ptr) (ptr)