This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Fix malloc_info statistic.
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: OndÅej BÃlka <neleai at seznam dot cz>, libc-alpha at sourceware dot org
- Date: Fri, 01 Nov 2013 10:20:34 -0400
- Subject: Re: [PATCH] Fix malloc_info statistic.
- Authentication-results: sourceware.org; auth=none
- References: <20131101101645 dot GB31228 at domone dot podge>
On 11/01/2013 06:16 AM, OndÅej BÃlka wrote:
> Hi, malloc_info could currently produce outputs like:
> ... snip
> <size from="32785" to="32785" total="32785" count="1"/>
> <size from="2512305" to="2512305" total="2512305" count="1"/>
> <unsorted from="8993" to="8386112020140800621"
> total="8316306148830692230" count="7526394837682317685"/>
> Bogus numbers in unsorted field are caused by that when we
> compute count we do not initialize sizes[NFASTBINS].count to zero.
> A computation of these duplicates computation for rest of bins that is
> just below. Handling first bin by this case fixes initialization issues.
> OK to commit?
> * malloc/malloc (malloc_info): Do not handle first bin as
> special case.
This looks good to me. As far as I can tell it's duplicated code for no
reason and the normal case below handles initialization of 0 to the
This is a user-visible issue, please file a bug for this, and then checkin
the fix with that bug number.