diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-07-30 18:14:14 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-07-30 18:14:14 +0000 |
commit | 45c82b1d8555901b6992bf9a30120fbb35a005ab (patch) | |
tree | f4856594ac021a4b9988433f782d2516dfb56606 /src/common/util.h | |
parent | 9fb77a6479a079aeb5698272c68bd50acdffe401 (diff) | |
download | tor-45c82b1d8555901b6992bf9a30120fbb35a005ab.tar.gz tor-45c82b1d8555901b6992bf9a30120fbb35a005ab.zip |
r14024@catbus: nickm | 2007-07-30 14:13:58 -0400
Glibc (and maybe others) define a mallinfo() that can be used to see how the platform malloc is acting inside. When we have it, dump its output on dumpmemusage().
svn:r10996
Diffstat (limited to 'src/common/util.h')
-rw-r--r-- | src/common/util.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/util.h b/src/common/util.h index 3cd19c06c0..b0db03f149 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -23,6 +23,9 @@ #ifdef HAVE_TIME_H #include <time.h> #endif +#ifdef HAVE_MALLOC_H +#include <malloc.h> +#endif /* Replace assert() with a variant that sends failures to the log before * calling assert() normally. @@ -105,6 +108,8 @@ extern int dmalloc_free(const char *file, const int line, void *pnt, #define tor_strndup(s, n) _tor_strndup(s, n DMALLOC_ARGS) #define tor_memdup(s, n) _tor_memdup(s, n DMALLOC_ARGS) +void tor_log_mallinfo(int severity); + /** Return the offset of <b>member</b> within the type <b>tp</b>, in bytes */ #if defined(__GNUC__) && __GNUC__ > 3 #define STRUCT_OFFSET(tp, member) __builtin_offsetof(tp, member) |