summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2019-10-30 18:03:14 -0400
committerAndreas K. Hüttel <dilfridge@gentoo.org>2019-11-25 23:02:26 +0100
commitadedd77b84123fd97f9162f8f8a6847bdad19d48 (patch)
treeed31671f0f4635235223cc06f2cbbcc1bdc746a7
parentmalloc: Various cleanups for malloc/tst-mxfast (diff)
downloadglibc-adedd77b84123fd97f9162f8f8a6847bdad19d48.tar.gz
glibc-adedd77b84123fd97f9162f8f8a6847bdad19d48.tar.bz2
glibc-adedd77b84123fd97f9162f8f8a6847bdad19d48.zip
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) (cherry picked from commit 919af705eef416f4469341dfdf4ca23450f30236)
-rw-r--r--malloc/malloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c
index fe973770a6..8c68b21b2b 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)