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