Fix set_max_fast in malloc.
authorUlrich Drepper <drepper@redhat.com>
Sat, 3 Apr 2010 16:43:10 +0000 (09:43 -0700)
committerUlrich Drepper <drepper@redhat.com>
Sat, 3 Apr 2010 16:43:10 +0000 (09:43 -0700)
ChangeLog
malloc/malloc.c

index dafce4d..f61697c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-04-03  Ulrich Drepper  <drepper@redhat.com>
+
+       * malloc/malloc.c (set_max_fast): Fix computation of the value.
+
 2010-03-30  David S. Miller  <davem@davemloft.net>
 
        * sysdeps/unix/sysv/linux/mmap64.c (__mmap64): Fix
index 6993aea..784919e 100644 (file)
@@ -2350,7 +2350,8 @@ typedef struct malloc_chunk* mfastbinptr;
 */
 
 #define set_max_fast(s) \
-  global_max_fast = ((s) == 0)? SMALLBIN_WIDTH: request2size(s)
+  global_max_fast = (((s) == 0)                                                      \
+                    ? SMALLBIN_WIDTH: ((s + SIZE_SZ) & ~MALLOC_ALIGN_MASK))
 #define get_max_fast() global_max_fast