public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] Base max_fast on alignment, not width, of bins (Bug 24903)
@ 2019-10-31 3:08 DJ Delorie
0 siblings, 0 replies; only message in thread
From: DJ Delorie @ 2019-10-31 3:08 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ff12e0fb91b9072800f031cb21fb2651ee7b6251
commit ff12e0fb91b9072800f031cb21fb2651ee7b6251
Author: DJ Delorie <dj@redhat.com>
Date: Wed Oct 30 18:03:14 2019 -0400
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.
Diff:
---
malloc/malloc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 5d3e82a..70cc35a 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)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-10-31 3:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-31 3:08 [glibc] Base max_fast on alignment, not width, of bins (Bug 24903) DJ Delorie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).