diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-11-30 18:11:26 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-11-30 18:11:26 +0000 |
commit | ac82d81538908636711b3b1824af682f47d4f64f (patch) | |
tree | 8f9bc8357b8f06eb18b574e17cbb3b43f6fd77e3 /src/common/util.c | |
parent | 188cb920d01349b256a49bd96b7e26c09c2d54af (diff) | |
download | tor-ac82d81538908636711b3b1824af682f47d4f64f.tar tor-ac82d81538908636711b3b1824af682f47d4f64f.tar.gz |
r16874@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.
svn:r12613
Diffstat (limited to 'src/common/util.c')
-rw-r--r-- | src/common/util.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/util.c b/src/common/util.c index 87f6aa5f1..03670c503 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -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 } /* ===== |