commit c769cbecb6214f518135c4bb2a52479747c2bf7b from: Alexander Barton date: Wed Aug 13 14:00:57 2008 UTC 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) commit - 707cc42dec2439da1fdee4ed3eb0e0a44d5ea9fe commit + c769cbecb6214f518135c4bb2a52479747c2bf7b blob - 7cbc80ac13653164754515de97dfc19be398122f blob + 36f0bc28afb18e27f728af621bd2bb739774156f --- configure.in +++ configure.in @@ -457,6 +457,7 @@ AC_ARG_ENABLE(debug, if test "$x_debug_on" = "yes"; then AC_DEFINE(DEBUG, 1) test "$GCC" = "yes" && CFLAGS="-pedantic $CFLAGS" + AC_CHECK_FUNCS(mtrace) fi # enable "strict RFC rules"? blob - 9239edfe11ca601a635dcf8977e188f7c1ccbac1 blob + 952a10a435beb4cd0c581be5a2d6ca1103568347 --- src/ngircd/ngircd.c +++ src/ngircd/ngircd.c @@ -83,6 +83,12 @@ main( int argc, const char *argv[] ) bool NGIRCd_NoDaemon = false; 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 );