arrfab / rpms / glibc

Forked from rpms/glibc 4 years ago
Clone

Blame SOURCES/glibc-rh1065574-1.patch

147e83
commit 8b35e35d0f4eae28a47c23e2aa15ddf570fa86ef
147e83
Author: Ondřej Bílka <neleai@seznam.cz>
147e83
Date:   Fri Nov 1 15:39:26 2013 +0100
147e83
147e83
    Fix malloc_info statistic. Fixes bug 16112
147e83
147e83
diff --git a/malloc/malloc.c b/malloc/malloc.c
147e83
index b47d99ac65344c82..c98b3f79ed38b4f0 100644
147e83
--- a/malloc/malloc.c
147e83
+++ b/malloc/malloc.c
147e83
@@ -5068,23 +5068,11 @@ malloc_info (int options, FILE *fp)
147e83
 	sizes[i].total = sizes[i].count * sizes[i].to;
147e83
       }
147e83
 
147e83
-    mbinptr bin = bin_at (ar_ptr, 1);
147e83
-    struct malloc_chunk *r = bin->fd;
147e83
-    if (r != NULL)
147e83
-      {
147e83
-	while (r != bin)
147e83
-	  {
147e83
-	    ++sizes[NFASTBINS].count;
147e83
-	    sizes[NFASTBINS].total += r->size;
147e83
-	    sizes[NFASTBINS].from = MIN (sizes[NFASTBINS].from, r->size);
147e83
-	    sizes[NFASTBINS].to = MAX (sizes[NFASTBINS].to, r->size);
147e83
-	    r = r->fd;
147e83
-	  }
147e83
-	nblocks += sizes[NFASTBINS].count;
147e83
-	avail += sizes[NFASTBINS].total;
147e83
-      }
147e83
 
147e83
-    for (size_t i = 2; i < NBINS; ++i)
147e83
+    mbinptr bin;
147e83
+    struct malloc_chunk *r;
147e83
+
147e83
+    for (size_t i = 1; i < NBINS; ++i)
147e83
       {
147e83
 	bin = bin_at (ar_ptr, i);
147e83
 	r = bin->fd;