From: Szabolcs Nagy <szabolcs.nagy@arm.com>
To: libc-alpha@sourceware.org, DJ Delorie <dj@redhat.com>
Subject: [PATCH 5/6] malloc: Remove unnecessary tagging around _mid_memalign
Date: Fri, 19 Mar 2021 13:27:27 +0000 [thread overview]
Message-ID: <7203bf2d0d1405daa5d1c62744abf8ceee85b5bb.1616155129.git.szabolcs.nagy@arm.com> (raw)
In-Reply-To: <cover.1616155129.git.szabolcs.nagy@arm.com>
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 | 10 ++--------
1 file 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 *
--
2.17.1
next prev parent reply other threads:[~2021-03-19 13:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-19 13:25 [PATCH 0/6] malloc: more memory tagging optimizations Szabolcs Nagy
2021-03-19 13:26 ` [PATCH 1/6] malloc: Use memsize instead of CHUNK_AVAILABLE_SIZE Szabolcs Nagy
2021-03-23 20:01 ` DJ Delorie
2021-03-19 13:26 ` [PATCH 2/6] malloc: Use different tag after mremap Szabolcs Nagy
2021-03-23 20:03 ` DJ Delorie
2021-03-19 13:26 ` [PATCH 3/6] malloc: Use chunk2rawmem throughout Szabolcs Nagy
2021-03-23 20:25 ` DJ Delorie
2021-03-19 13:27 ` [PATCH 4/6] malloc: Rename chunk2rawmem Szabolcs Nagy
2021-03-23 20:43 ` DJ Delorie
2021-03-19 13:27 ` Szabolcs Nagy [this message]
2021-03-23 20:44 ` [PATCH 5/6] malloc: Remove unnecessary tagging around _mid_memalign DJ Delorie
2021-03-19 13:27 ` [PATCH 6/6] malloc: Ensure mtag code path in checked_request2size is cold Szabolcs Nagy
2021-03-23 20:46 ` DJ Delorie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7203bf2d0d1405daa5d1c62744abf8ceee85b5bb.1616155129.git.szabolcs.nagy@arm.com \
--to=szabolcs.nagy@arm.com \
--cc=dj@redhat.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).