d8307d
commit f144981490bd2ab13189d85902ca74beecb307e4
d8307d
Author: DJ Delorie <dj@redhat.com>
d8307d
Date:   Wed Oct 30 18:03:14 2019 -0400
d8307d
d8307d
    Base max_fast on alignment, not width, of bins (Bug 24903)
d8307d
    
d8307d
    set_max_fast sets the "impossibly small" value based on,
d8307d
    eventually, MALLOC_ALIGNMENT.  The comparisons for the smallest
d8307d
    chunk used is, eventually, MIN_CHUNK_SIZE.  Note that i386
d8307d
    is the only platform where these are the same, so a smallest
d8307d
    chunk *would* be put in a no-fastbins fastbin.
d8307d
    
d8307d
    This change calculates the "impossibly small" value
d8307d
    based on MIN_CHUNK_SIZE instead, so that we can know it will
d8307d
    always be impossibly small.
d8307d
    
d8307d
    (cherry picked from commit ff12e0fb91b9072800f031cb21fb2651ee7b6251)
d8307d
d8307d
diff --git a/malloc/malloc.c b/malloc/malloc.c
d8307d
index 9756ed0a0d28c5f6..90825b2aaed53761 100644
d8307d
--- a/malloc/malloc.c
d8307d
+++ b/malloc/malloc.c
d8307d
@@ -1635,7 +1635,7 @@ static INTERNAL_SIZE_T global_max_fast;
d8307d
 
d8307d
 #define set_max_fast(s) \
d8307d
   global_max_fast = (((s) == 0)						      \
d8307d
-                     ? SMALLBIN_WIDTH : ((s + SIZE_SZ) & ~MALLOC_ALIGN_MASK))
d8307d
+                     ? MIN_CHUNK_SIZE / 2 : ((s + SIZE_SZ) & ~MALLOC_ALIGN_MASK))
d8307d
 
d8307d
 static inline INTERNAL_SIZE_T
d8307d
 get_max_fast (void)