public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/release/2.30/master] Base max_fast on alignment, not width, of bins (Bug 24903)
@ 2019-11-19 12:12 Arjun Shankar
  0 siblings, 0 replies; only message in thread
From: Arjun Shankar @ 2019-11-19 12:12 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=919af705eef416f4469341dfdf4ca23450f30236

commit 919af705eef416f4469341dfdf4ca23450f30236
Author: DJ Delorie <dj@redhat.com>
Date:   Wed Oct 30 18:03:14 2019 -0400

    Base max_fast on alignment, not width, of bins (Bug 24903)
    
    set_max_fast sets the "impossibly small" value based on,
    eventually, MALLOC_ALIGNMENT.  The comparisons for the smallest
    chunk used is, eventually, MIN_CHUNK_SIZE.  Note that i386
    is the only platform where these are the same, so a smallest
    chunk *would* be put in a no-fastbins fastbin.
    
    This change calculates the "impossibly small" value
    based on MIN_CHUNK_SIZE instead, so that we can know it will
    always be impossibly small.
    
    (cherry picked from commit ff12e0fb91b9072800f031cb21fb2651ee7b6251)

Diff:
---
 malloc/malloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/malloc/malloc.c b/malloc/malloc.c
index fe97377..8c68b21 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -1621,7 +1621,7 @@ static INTERNAL_SIZE_T global_max_fast;
 
 #define set_max_fast(s) \
   global_max_fast = (((s) == 0)						      \
-                     ? SMALLBIN_WIDTH : ((s + SIZE_SZ) & ~MALLOC_ALIGN_MASK))
+                     ? MIN_CHUNK_SIZE / 2 : ((s + SIZE_SZ) & ~MALLOC_ALIGN_MASK))
 
 static inline INTERNAL_SIZE_T
 get_max_fast (void)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-19 12:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-19 12:12 [glibc/release/2.30/master] Base max_fast on alignment, not width, of bins (Bug 24903) Arjun Shankar

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