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