]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
r16874@catbus: nickm | 2007-11-30 13:11:09 -0500
authorNick Mathewson <nickm@torproject.org>
Fri, 30 Nov 2007 18:11:26 +0000 (18:11 +0000)
committerNick Mathewson <nickm@torproject.org>
Fri, 30 Nov 2007 18:11:26 +0000 (18:11 +0000)
 When using dmalloc, dump the top ten memory consumers to the _DMALLOC_ logfile when we get a SIGUSR1.  Hint: it is not what you would think.

svn:r12613

ChangeLog
src/common/util.c

index 2c46609c555d21865f801da6e779006377abcc26..3239e7ba96891698ba3ebb12d42e43a05c279086 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,10 @@ Changes in version 0.2.0.13-alpha - 2007-11-??
       to build a descriptor with no intro points (and it would have
       crashed if we had tried to parse one). Bugfix on 0.2.0.x; patch
       by Karsten Loesing.
+    - Fix building with dmalloc 5.5.2 with glibc.
+
+  o Minor features:
+    - On USR1, when dmalloc is in use, log the top 10 memory consumers. 
 
 
 Changes in version 0.2.0.12-alpha - 2007-11-16
index 87f6aa5f1845f449f098911b60e72a30aa21bb38..03670c503bcaeabce91223bbe517bce40fdf6067 100644 (file)
@@ -76,8 +76,10 @@ const char util_c_id[] = "$Id$";
  * Memory management
  * ===== */
 #ifdef USE_DMALLOC
+ #undef strndup
  #include <dmalloc.h>
  #define DMALLOC_FN_ARGS , file, line
+ #define dmalloc_strdup(file, line, string, xalloc_b) dmalloc_strndup(file, line, (string), -1, xalloc_b)
 #else
  #define dmalloc_strdup(file, line, string, xalloc_b) strdup(string)
 
@@ -228,6 +230,10 @@ tor_log_mallinfo(int severity)
 #else
   (void)severity;
 #endif
+#ifdef USE_DMALLOC
+  dmalloc_log_stats();
+  // too wordy dmalloc_log_unfreed();
+#endif
 }
 
 /* =====