summaryrefslogtreecommitdiff
path: root/sysdeps/generic
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2021-01-29 17:07:28 +0000
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2021-03-26 11:03:06 +0000
commitc076a0bc698c537f72c33bad2925f4e3da59d23c (patch)
tree188e36bfaa2c51ca50df2f1ef882a8fd57a61780 /sysdeps/generic
parent42bac88a211a7fac9dd1bfe7d1e45e59ac50c24f (diff)
downloadglibc-c076a0bc698c537f72c33bad2925f4e3da59d23c.tar.gz
malloc: Only support zeroing and not arbitrary memset with mtag
The memset api is suboptimal and does not provide much benefit. Memory tagging only needs a zeroing memset (and only for memory that's sized and aligned to multiples of the tag granule), so change the internal api and the target hooks accordingly. This is to simplify the implementation of the target hook. Reviewed-by: DJ Delorie <dj@redhat.com>
Diffstat (limited to 'sysdeps/generic')
-rw-r--r--sysdeps/generic/libc-mtag.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/sysdeps/generic/libc-mtag.h b/sysdeps/generic/libc-mtag.h
index e8fc236b6c..4743e873f1 100644
--- a/sysdeps/generic/libc-mtag.h
+++ b/sysdeps/generic/libc-mtag.h
@@ -44,12 +44,12 @@ __libc_mtag_tag_region (void *p, size_t n)
return p;
}
-/* Optimized equivalent to __libc_mtag_tag_region followed by memset. */
+/* Optimized equivalent to __libc_mtag_tag_region followed by memset to 0. */
static inline void *
-__libc_mtag_memset_with_tag (void *p, int c, size_t n)
+__libc_mtag_tag_zero_region (void *p, size_t n)
{
__libc_mtag_link_error ();
- return memset (p, c, n);
+ return memset (p, 0, n);
}
/* Convert address P to a pointer that is tagged correctly for that