about summary refs log tree commit diff
path: root/malloc
diff options
context:
space:
mode:
authorOndřej Bílka <neleai@seznam.cz>2013-11-01 15:39:26 +0100
committerOndřej Bílka <neleai@seznam.cz>2013-11-01 15:39:26 +0100
commit8b35e35d0f4eae28a47c23e2aa15ddf570fa86ef (patch)
tree4b9a50c8756f620f890cd88d6e93bba30151bea3 /malloc
parent8f5de63892b491856400a394632b46c3b1be642d (diff)
downloadglibc-8b35e35d0f4eae28a47c23e2aa15ddf570fa86ef.tar.gz
glibc-8b35e35d0f4eae28a47c23e2aa15ddf570fa86ef.tar.xz
glibc-8b35e35d0f4eae28a47c23e2aa15ddf570fa86ef.zip
Fix malloc_info statistic. Fixes bug 16112
Diffstat (limited to 'malloc')
-rw-r--r--malloc/malloc.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 29796fe461..897c43a39d 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -5049,23 +5049,11 @@ malloc_info (int options, FILE *fp)
 	sizes[i].total = sizes[i].count * sizes[i].to;
       }
 
-    mbinptr bin = bin_at (ar_ptr, 1);
-    struct malloc_chunk *r = bin->fd;
-    if (r != NULL)
-      {
-	while (r != bin)
-	  {
-	    ++sizes[NFASTBINS].count;
-	    sizes[NFASTBINS].total += r->size;
-	    sizes[NFASTBINS].from = MIN (sizes[NFASTBINS].from, r->size);
-	    sizes[NFASTBINS].to = MAX (sizes[NFASTBINS].to, r->size);
-	    r = r->fd;
-	  }
-	nblocks += sizes[NFASTBINS].count;
-	avail += sizes[NFASTBINS].total;
-      }
 
-    for (size_t i = 2; i < NBINS; ++i)
+    mbinptr bin;
+    struct malloc_chunk *r;
+
+    for (size_t i = 1; i < NBINS; ++i)
       {
 	bin = bin_at (ar_ptr, i);
 	r = bin->fd;