]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Thu, 20 Sep 2001 19:36:46 +0000 (19:36 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 20 Sep 2001 19:36:46 +0000 (19:36 +0000)
* malloc/memusage.c (realloc): Don't count already allocated
memory in the sums.
(me): Always use dlsym() to find the real implementations.

ChangeLog
malloc/memusage.c

index 0e1dcfe9b63e7c8a65e5fbaf6a7910b61c140ca7..ada11dd9405f1b5c9806e59ad12016ce3e7f984c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,8 @@
 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.
 
index 19bb35f94ff0b9f1957a123195707db3f3078499..b35444da109ea903d4671833783a8e74fc3192e5 100644 (file)
@@ -357,10 +357,13 @@ realloc (void *old, size_t len)
 
   /* 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];