1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-02 00:22:11 +03:00

Add --enable-dmalloc to link against the dmalloc malloc debugger.

It's not as strong as Insure, but it's free, reasonably efficient and
works on every platform.
This commit is contained in:
Martin Pool
-
parent 412e79c448
commit e76d27fcdb
5 changed files with 833 additions and 788 deletions

1593
source/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -33,6 +33,14 @@ AC_ARG_ENABLE(developer, [ --enable-developer turn on developer warnings a
CFLAGS="${CFLAGS} -g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -DDEBUG_PASSWORD -DDEVELOPER"
fi])
AC_ARG_ENABLE(dmalloc, [ --enable-dmalloc enable heap debugging [default=no]])
if test "x$enable_dmalloc" = xyes
then
AC_DEFINE(ENABLE_DMALLOC, 1, [Define to turn on dmalloc debugging])
LIBS="$LIBS -ldmalloc"
fi
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL

View File

@ -1,4 +1,4 @@
/* include/config.h.in. Generated automatically from configure.in by autoheader. */
/* include/config.h.in. Generated automatically from configure.in by autoheader 2.13. */
/* Define if on AIX 3.
System headers sometimes define this.
@ -1082,6 +1082,9 @@
/* Define if you have the socket library (-lsocket). */
#undef HAVE_LIBSOCKET
/* Define to turn on dmalloc debugging */
#undef ENABLE_DMALLOC
/* Do we have rl_completion_matches? */
#undef HAVE_NEW_LIBREADLINE

View File

@ -975,6 +975,13 @@ int vasprintf(char **ptr, const char *format, va_list ap);
#include <dlfcn.h>
#endif
/* dmalloc -- free heap debugger (dmalloc.org). This should be near
* the *bottom* of include files so as not to conflict. */
#ifdef DMALLOC
# include <dmalloc.h>
#endif
/* Some POSIX definitions for those without */
#ifndef S_IFDIR

View File

@ -45,7 +45,13 @@
* memory it contains all in one allocation, which might be a bit
* faster and perhaps use less memory overhead.
*
* That smells like a premature optimization, though. -- mbp */
* That smells like a premature optimization, though. -- mbp
**/
/**
* If you want testing for memory corruption, link with dmalloc or use
* Insure++. It doesn't seem useful to duplicate them here.
**/
#include "includes.h"