aboutsummaryrefslogtreecommitdiff
path: root/malloc/arena.c
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2021-02-16 14:12:25 +0000
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2021-03-26 11:03:06 +0000
commit0c719cf42c982ce627179cde4fd583bcca6417bd (patch)
tree19c2b524aa08657b12827ada7edf9a7d72abd620 /malloc/arena.c
parente865dcbb7b3319fc6b03939edae0769154051d84 (diff)
downloadglibc-0c719cf42c982ce627179cde4fd583bcca6417bd.zip
glibc-0c719cf42c982ce627179cde4fd583bcca6417bd.tar.gz
glibc-0c719cf42c982ce627179cde4fd583bcca6417bd.tar.bz2
malloc: Refactor TAG_ macros to avoid indirection
This does not change behaviour, just removes one layer of indirection in the internal memory tagging logic. Use tag_ and mtag_ prefixes instead of __tag_ and __mtag_ since these are all symbols with internal linkage, private to malloc.c, so there is no user namespace pollution issue. Reviewed-by: DJ Delorie <dj@redhat.com>
Diffstat (limited to 'malloc/arena.c')
-rw-r--r--malloc/arena.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/malloc/arena.c b/malloc/arena.c
index 0777dc7..d0778fe 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -332,12 +332,12 @@ ptmalloc_init (void)
if (__MTAG_SBRK_UNTAGGED)
__morecore = __failing_morecore;
- __mtag_mmap_flags = __MTAG_MMAP_FLAGS;
- __tag_new_memset = __mtag_tag_new_memset;
- __tag_region = __libc_mtag_tag_region;
- __tag_new_usable = __mtag_tag_new_usable;
- __tag_at = __libc_mtag_address_get_tag;
- __mtag_granule_mask = ~(size_t)(__MTAG_GRANULE_SIZE - 1);
+ mtag_mmap_flags = __MTAG_MMAP_FLAGS;
+ tag_new_memset = __mtag_tag_new_memset;
+ tag_region = __libc_mtag_tag_region;
+ tag_new_usable = __mtag_tag_new_usable;
+ tag_at = __libc_mtag_address_get_tag;
+ mtag_granule_mask = ~(size_t)(__MTAG_GRANULE_SIZE - 1);
}
#endif
@@ -557,7 +557,7 @@ new_heap (size_t size, size_t top_pad)
}
}
}
- if (__mprotect (p2, size, MTAG_MMAP_FLAGS | PROT_READ | PROT_WRITE) != 0)
+ if (__mprotect (p2, size, mtag_mmap_flags | PROT_READ | PROT_WRITE) != 0)
{
__munmap (p2, HEAP_MAX_SIZE);
return 0;
@@ -587,7 +587,7 @@ grow_heap (heap_info *h, long diff)
{
if (__mprotect ((char *) h + h->mprotect_size,
(unsigned long) new_size - h->mprotect_size,
- MTAG_MMAP_FLAGS | PROT_READ | PROT_WRITE) != 0)
+ mtag_mmap_flags | PROT_READ | PROT_WRITE) != 0)
return -2;
h->mprotect_size = new_size;