From 2ed3ff7341747b11269845a68781705323d19694 Mon Sep 17 00:00:00 2001 From: jasone Date: Wed, 10 May 2006 00:07:45 +0000 Subject: [PATCH] Increase the minimum chunk size by a power of two (32kB --> 64kB, assuming 4kB pages), in order to avoid dangerous rounding error when calculating fullness limits during run promotion/demotion. Convert a structure bitfield to a normal field in areana_run_t. This should have been changed along with the other fields in revision 1.120. --- lib/libc/stdlib/malloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index 398422c37ad4..f25839f82701 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -521,7 +521,7 @@ struct arena_run_s { unsigned regs_minelm; /* Number of free regions in run. */ - unsigned nfree:(RUN_MIN_REGS_2POW + 2); + unsigned nfree; /* * Current quartile for this run, one of: {RUN_QINIT, RUN_Q0, RUN_25, @@ -3100,7 +3100,7 @@ malloc_init_hard(void) * enough resolution if there are too few * regions for the largest bin size classes. */ - if (opt_chunk_2pow > pagesize_2pow + 3) + if (opt_chunk_2pow > pagesize_2pow + 4) opt_chunk_2pow--; break; case 'K':