diff options
author | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2021-03-12 14:30:10 +0000 |
---|---|---|
committer | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2021-03-19 11:46:21 +0000 |
commit | 7203bf2d0d1405daa5d1c62744abf8ceee85b5bb (patch) | |
tree | 61ef4bd34b87d480bb0f28da3542f562aa8526b4 | |
parent | 39adedfcc466045b1087f037f35ca437991e1c17 (diff) | |
download | glibc-7203bf2d0d1405daa5d1c62744abf8ceee85b5bb.tar glibc-7203bf2d0d1405daa5d1c62744abf8ceee85b5bb.tar.gz glibc-7203bf2d0d1405daa5d1c62744abf8ceee85b5bb.tar.bz2 glibc-7203bf2d0d1405daa5d1c62744abf8ceee85b5bb.zip |
malloc: Remove unnecessary tagging around _mid_memalign
The internal _mid_memalign already returns newly tagged memory.
(__libc_memalign and posix_memalign already relied on this, this
patch fixes the other call sites.)
-rw-r--r-- | malloc/malloc.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c index 6f87b7bdb1..cb1837d0d7 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -3553,22 +3553,17 @@ libc_hidden_def (__libc_memalign) void * __libc_valloc (size_t bytes) { - void *p; - if (__malloc_initialized < 0) ptmalloc_init (); void *address = RETURN_ADDRESS (0); size_t pagesize = GLRO (dl_pagesize); - p = _mid_memalign (pagesize, bytes, address); - return tag_new_usable (p); + return _mid_memalign (pagesize, bytes, address); } void * __libc_pvalloc (size_t bytes) { - void *p; - if (__malloc_initialized < 0) ptmalloc_init (); @@ -3585,8 +3580,7 @@ __libc_pvalloc (size_t bytes) } rounded_bytes = rounded_bytes & -(pagesize - 1); - p = _mid_memalign (pagesize, rounded_bytes, address); - return tag_new_usable (p); + return _mid_memalign (pagesize, rounded_bytes, address); } void * |