public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Robert Morell <rmorell@nvidia.com>
To: <libc-alpha@sourceware.org>
Cc: <adhemerval.zanella@linaro.org>, <dj@redhat.com>,
	<carlos@redhat.com>, <siddhesh@sourceware.org>
Subject: [PATCH] malloc: Fix transposed arguments in sysmalloc_mmap_fallback call
Date: Tue, 28 Feb 2023 13:20:20 -0800	[thread overview]
Message-ID: <Y/5wFE+YCYJ/yr0j@morell> (raw)

git commit 0849eed45daa ("malloc: Move MORECORE fallback mmap to
sysmalloc_mmap_fallback") moved a block of code from sysmalloc to a
new helper function sysmalloc_mmap_fallback(), but 'pagesize' is used
for the 'minsize' argument and 'MMAP_AS_MORECORE_SIZE' for the
'pagesize' argument.

Fixes: 0849eed45daa ("malloc: Move MORECORE fallback mmap to sysmalloc_mmap_fallback")
Signed-off-by: Robert Morell <rmorell@nvidia.com>
---
 malloc/malloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/malloc/malloc.c b/malloc/malloc.c
index 5829f3fa9b4b..76c50e3f5817 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -2725,8 +2725,8 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av)
 					    mp_.hp_flags, av);
 #endif
 	  if (mbrk == MAP_FAILED)
-	    mbrk = sysmalloc_mmap_fallback (&size, nb, old_size, pagesize,
-					    MMAP_AS_MORECORE_SIZE, 0, av);
+	    mbrk = sysmalloc_mmap_fallback (&size, nb, old_size, MMAP_AS_MORECORE_SIZE,
+					    pagesize, 0, av);
 	  if (mbrk != MAP_FAILED)
 	    {
 	      /* We do not need, and cannot use, another sbrk call to find end */
-- 
2.39.2


             reply	other threads:[~2023-02-28 21:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-28 21:20 Robert Morell [this message]
2023-03-07 13:13 ` Adhemerval Zanella Netto
2023-03-07 18:43   ` DJ Delorie
2023-03-07 18:53     ` Robert Morell

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=Y/5wFE+YCYJ/yr0j@morell \
    --to=rmorell@nvidia.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=carlos@redhat.com \
    --cc=dj@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=siddhesh@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).