* malloc/memusage.c (realloc): Don't count already allocated
	memory in the sums.
	(me): Always use dlsym() to find the real implementations.
This commit is contained in:
Ulrich Drepper 2001-09-20 19:36:46 +00:00
parent 0e21f7767e
commit d3acfb610f
2 changed files with 10 additions and 6 deletions

View file

@ -1,7 +1,8 @@
2001-09-20 Ulrich Drepper <drepper@redhat.com> 2001-09-20 Ulrich Drepper <drepper@redhat.com>
* malloc/memusage.c (me): Always use dlsym() to find the real * malloc/memusage.c (realloc): Don't count already allocated
implementations. memory in the sums.
(me): Always use dlsym() to find the real implementations.
* malloc/memusage.sh: Make -n option actually do something. * malloc/memusage.sh: Make -n option actually do something.

View file

@ -357,10 +357,13 @@ realloc (void *old, size_t len)
/* Keep track of number of calls. */ /* Keep track of number of calls. */
++calls[idx_realloc]; ++calls[idx_realloc];
/* Keep track of total memory consumption for `realloc'. */ if (len > old_len)
total[idx_realloc] += len; {
/* Keep track of total memory requirement. */ /* Keep track of total memory consumption for `realloc'. */
grand_total += len; total[idx_realloc] += len - old_len;
/* Keep track of total memory requirement. */
grand_total += len - old_len;
}
/* Remember the size of the request. */ /* Remember the size of the request. */
if (len < 65536) if (len < 65536)
++histogram[len / 16]; ++histogram[len / 16];