This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix malloc_info statistic.

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"/>
> </sizes>
> 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
required fields.

This is a user-visible issue, please file a bug for this, and then checkin
the fix with that bug number.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]