[or-cvs] r12613: When using dmalloc, dump the top ten memory consumers to the (in tor/trunk: . src/common)

nickm at seul.org nickm at seul.org
Fri Nov 30 18:11:26 UTC 2007


Author: nickm
Date: 2007-11-30 13:11:26 -0500 (Fri, 30 Nov 2007)
New Revision: 12613

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/src/common/util.c
Log:
 r16874 at catbus:  nickm | 2007-11-30 13:11:09 -0500
 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.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r16874] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-11-30 17:23:46 UTC (rev 12612)
+++ tor/trunk/ChangeLog	2007-11-30 18:11:26 UTC (rev 12613)
@@ -18,8 +18,12 @@
       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
   This twelfth development snapshot fixes some more build problems as
   well as a few minor bugs.

Modified: tor/trunk/src/common/util.c
===================================================================
--- tor/trunk/src/common/util.c	2007-11-30 17:23:46 UTC (rev 12612)
+++ tor/trunk/src/common/util.c	2007-11-30 18:11:26 UTC (rev 12613)
@@ -76,8 +76,10 @@
  * 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 @@
 #else
   (void)severity;
 #endif
+#ifdef USE_DMALLOC
+  dmalloc_log_stats();
+  // too wordy dmalloc_log_unfreed();
+#endif
 }
 
 /* =====



More information about the tor-commits mailing list