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)
This commit is contained in:
parent
707cc42dec
commit
c769cbecb6
|
@ -457,6 +457,7 @@ AC_ARG_ENABLE(debug,
|
||||||
if test "$x_debug_on" = "yes"; then
|
if test "$x_debug_on" = "yes"; then
|
||||||
AC_DEFINE(DEBUG, 1)
|
AC_DEFINE(DEBUG, 1)
|
||||||
test "$GCC" = "yes" && CFLAGS="-pedantic $CFLAGS"
|
test "$GCC" = "yes" && CFLAGS="-pedantic $CFLAGS"
|
||||||
|
AC_CHECK_FUNCS(mtrace)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# enable "strict RFC rules"?
|
# enable "strict RFC rules"?
|
||||||
|
|
|
@ -84,6 +84,12 @@ main( int argc, const char *argv[] )
|
||||||
int i;
|
int i;
|
||||||
size_t n;
|
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 );
|
umask( 0077 );
|
||||||
|
|
||||||
NGIRCd_SignalQuit = NGIRCd_SignalRestart = NGIRCd_SignalRehash = false;
|
NGIRCd_SignalQuit = NGIRCd_SignalRestart = NGIRCd_SignalRehash = false;
|
||||||
|
|
Loading…
Reference in New Issue