public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] malloc: Fix transposed arguments in sysmalloc_mmap_fallback call
@ 2023-02-28 21:20 Robert Morell
  2023-03-07 13:13 ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Morell @ 2023-02-28 21:20 UTC (permalink / raw)
  To: libc-alpha; +Cc: adhemerval.zanella, dj, carlos, siddhesh

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-07 18:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-28 21:20 [PATCH] malloc: Fix transposed arguments in sysmalloc_mmap_fallback call Robert Morell
2023-03-07 13:13 ` Adhemerval Zanella Netto
2023-03-07 18:43   ` DJ Delorie
2023-03-07 18:53     ` Robert Morell

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).