]> sourceware.org Git - glibc.git/commitdiff
malloc: Remove unnecessary tagging around _mid_memalign
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Fri, 12 Mar 2021 14:30:10 +0000 (14:30 +0000)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Fri, 19 Mar 2021 11:46:21 +0000 (11:46 +0000)
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.)

malloc/malloc.c

index 6f87b7bdb1c6e0cbd1de543f1d5e2044b6f2f597..cb1837d0d7818d028ff132fd88fecae4a60d933b 100644 (file)
@@ -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 *
This page took 0.044957 seconds and 5 git commands to generate.