* malloc/memusage.c (realloc): Don't count already allocated
memory in the sums.
(me): Always use dlsym() to find the real implementations.
2001-09-20 Ulrich Drepper <drepper@redhat.com>
- * malloc/memusage.c (me): Always use dlsym() to find the real
- implementations.
+ * malloc/memusage.c (realloc): Don't count already allocated
+ memory in the sums.
+ (me): Always use dlsym() to find the real implementations.
* malloc/memusage.sh: Make -n option actually do something.
/* Keep track of number of calls. */
++calls[idx_realloc];
- /* Keep track of total memory consumption for `realloc'. */
- total[idx_realloc] += len;
- /* Keep track of total memory requirement. */
- grand_total += len;
+ if (len > old_len)
+ {
+ /* Keep track of total memory consumption for `realloc'. */
+ total[idx_realloc] += len - old_len;
+ /* Keep track of total memory requirement. */
+ grand_total += len - old_len;
+ }
/* Remember the size of the request. */
if (len < 65536)
++histogram[len / 16];