about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2008-08-13 16:00:57 +0200
committerAlexander Barton <alex@barton.de>2008-08-13 16:00:57 +0200
commitc769cbecb6214f518135c4bb2a52479747c2bf7b (patch)
tree518d4fa3b3f21c1a9b268013b95f3e608a1f7799 /src
parent707cc42dec2439da1fdee4ed3eb0e0a44d5ea9fe (diff)
downloadngircd-c769cbecb6214f518135c4bb2a52479747c2bf7b.tar.gz
ngircd-c769cbecb6214f518135c4bb2a52479747c2bf7b.zip
Enable GNU libc "memory tracing" when compiled with debug code.
This patch lets ngIRCd activate "memory tracing" of the GNU libc when
compiled with debug code (configure: --enable-debug) and the functionality
is available on the system.
(http://www.gnu.org/software/libc/manual/html_node/Allocation-Debugging.html)
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/ngircd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ngircd/ngircd.c b/src/ngircd/ngircd.c
index 9239edfe..952a10a4 100644
--- a/src/ngircd/ngircd.c
+++ b/src/ngircd/ngircd.c
@@ -84,6 +84,12 @@ main( int argc, const char *argv[] )
 	int i;
 	size_t n;
 
+#if defined(DEBUG) && defined(HAVE_MTRACE)
+	/* enable GNU libc memory tracing when running in debug mode
+	 * and functionality available */
+	mtrace();
+#endif
+
 	umask( 0077 );
 
 	NGIRCd_SignalQuit = NGIRCd_SignalRestart = NGIRCd_SignalRehash = false;