1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

Fix malloc_info statistic. Fixes bug 16112

This commit is contained in:
Ondřej Bílka
2013-11-01 15:39:26 +01:00
parent 8f5de63892
commit 8b35e35d0f
3 changed files with 11 additions and 17 deletions

View File

@ -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;