]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* malloc/malloc.c (malloc_info): Also output system memory information.
authorUlrich Drepper <drepper@redhat.com>
Sat, 18 Apr 2009 05:14:52 +0000 (05:14 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 18 Apr 2009 05:14:52 +0000 (05:14 +0000)
ChangeLog
malloc/malloc.c

index 503d4b6de88a9a9eef9763937b0e0c06ee1cba17..1c3ddbdc32ff24d69df4ed414185d20a1eda622e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2009-04-17  Ulrich Drepper  <drepper@redhat.com>
 
+       * malloc/malloc.c (malloc_info): Also output system memory information.
+
        * sysdeps/unix/sysv/linux/kernel-features.h: All supported
        architectures have preadv/pwritev in 2.6.30.
 
index 3bd19b0ca9b0b63bba6a97408241f1671ecd7d08..c9141f7fb868172e8ffd66e4b1f6f1caa27c5474 100644 (file)
   This is a version (aka ptmalloc2) of malloc/free/realloc written by
   Doug Lea and adapted to multiple threads/arenas by Wolfram Gloger.
 
+  There have been substantial changesmade after the integration into
+  glibc in all parts of the code.  Do not look for much commonality
+  with the ptmalloc2 version.
+
 * Version ptmalloc2-20011215
   based on:
   VERSION 2.7.0 Sun Mar 11 14:14:06 2001  Doug Lea  (dl at gee)
@@ -6245,6 +6249,8 @@ malloc_info (int options, FILE *fp)
   size_t total_nfastblocks = 0;
   size_t total_avail = 0;
   size_t total_fastavail = 0;
+  size_t total_system = 0;
+  size_t total_max_system = 0;
 
   void mi_arena (mstate ar_ptr)
   {
@@ -6350,11 +6356,17 @@ malloc_info (int options, FILE *fp)
               sizes[NFASTBINS].from, sizes[NFASTBINS].to,
               sizes[NFASTBINS].total, sizes[NFASTBINS].count);
 
+    total_system += ar_ptr->system_mem;
+    total_max_system += ar_ptr->max_system_mem;
+
     fprintf (fp,
             "</sizes>\n<total type=\"fast\" count=\"%zu\" size=\"%zu\"/>\n"
             "<total type=\"rest\" count=\"%zu\" size=\"%zu\"/>\n"
+            "<system type=\"current\" size=\"%zu\"/>\n"
+            "<system type=\"max\" size=\"%zu\"/>\n"
             "</heap>\n",
-            nfastblocks, fastavail, nblocks, avail);
+            nfastblocks, fastavail, nblocks, avail,
+            ar_ptr->system_mem, ar_ptr->max_system_mem);
   }
 
   fputs ("<malloc version=\"1\">\n", fp);
@@ -6371,8 +6383,11 @@ malloc_info (int options, FILE *fp)
   fprintf (fp,
           "<total type=\"fast\" count=\"%zu\" size=\"%zu\"/>\n"
           "<total type=\"rest\" count=\"%zu\" size=\"%zu\"/>\n"
+          "<system type=\"current\" size=\"%zu\n/>\n"
+          "<system type=\"max\" size=\"%zu\n/>\n"
           "</malloc>\n",
-          total_nfastblocks, total_fastavail, total_nblocks, total_avail);
+          total_nfastblocks, total_fastavail, total_nblocks, total_avail,
+          total_system, total_max_system);
 
   return 0;
 }