diff options
author | DJ Delorie <dj@redhat.com> | 2019-10-30 18:03:14 -0400 |
---|---|---|
committer | Arjun Shankar <ashankar@redhat.com> | 2019-10-31 16:48:04 +0100 |
commit | f144981490bd2ab13189d85902ca74beecb307e4 (patch) | |
tree | d261e2dfe2e73c14564f070a8e3ef21af85cee97 | |
parent | 91d5989356325759503311df67e750b358ef4148 (diff) | |
download | glibc-f144981490bd2ab13189d85902ca74beecb307e4.tar glibc-f144981490bd2ab13189d85902ca74beecb307e4.tar.gz glibc-f144981490bd2ab13189d85902ca74beecb307e4.tar.bz2 glibc-f144981490bd2ab13189d85902ca74beecb307e4.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)
-rw-r--r-- | malloc/malloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c index e460b92782..63a6cec350 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -1628,7 +1628,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) |