aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-10-13 20:53:14 +0000
committerUlrich Drepper <drepper@redhat.com>2006-10-13 20:53:14 +0000
commitcc7eecbfc09fb9f1c9e1aa33e8490f1ade0530b3 (patch)
tree2687e5c28506d4da77485f8a8ea9c24c1ceb19c1
parentdbc3d56b704c7858de411b59688efe7860dfe580 (diff)
downloadglibc-cc7eecbfc09fb9f1c9e1aa33e8490f1ade0530b3.tar
glibc-cc7eecbfc09fb9f1c9e1aa33e8490f1ade0530b3.tar.gz
glibc-cc7eecbfc09fb9f1c9e1aa33e8490f1ade0530b3.tar.bz2
glibc-cc7eecbfc09fb9f1c9e1aa33e8490f1ade0530b3.zip
[BZ #3313]
* malloc/malloc.c (malloc_consolidate): Don't use get_fast_max to determine highest fast bin to consolidate, always look into all of them. (do_check_malloc_state): Only require for empty bins for large sizes in main arena.
-rw-r--r--ChangeLog8
-rw-r--r--malloc/malloc.c8
2 files changed, 14 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 941d2f4223..76654d30c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,11 @@
2006-10-13 Ulrich Drepper <drepper@redhat.com>
- * malloc/malloc.c (do_check_malloc_state): Only require for empty
- bins for large sizes in main arena.
+ [BZ #3313]
+ * malloc/malloc.c (malloc_consolidate): Don't use get_fast_max to
+ determine highest fast bin to consolidate, always look into all of
+ them.
+ (do_check_malloc_state): Only require for empty bins for large
+ sizes in main arena.
* libio/stdio.h: Add more __wur attributes.
diff --git a/malloc/malloc.c b/malloc/malloc.c
index e4b693c342..38ceb1e909 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -4692,7 +4692,15 @@ static void malloc_consolidate(av) mstate av;
reused anyway.
*/
+#if 0
+ /* It is wrong to limit the fast bins to search using get_max_fast
+ because, except for the main arena, all the others might have
+ blocks in the high fast bins. It's not worth it anyway, just
+ search all bins all the time. */
maxfb = &(av->fastbins[fastbin_index(get_max_fast ())]);
+#else
+ maxfb = &(av->fastbins[NFASTBINS]);
+#endif
fb = &(av->fastbins[0]);
do {
if ( (p = *fb) != 0) {