The dmalloc library is an useful tool to debug memory problems in
your programs, but you don't really want to compile
dmalloc-support into every binary you produce, because dmalloc
brings performance loss.
The PETI_WITH_DMALLOC macro defines a user switch '--with-dmalloc'
which can be used likes this:
./configure --with-dmalloc[=BASE-PATH]
If no BASE-PATH has been provided, "/usr/local" will be used as
default.
The BASE-PATH is the place where autoconf expects to find the
include- and link library files of dmalloc, specifically in:
$(BASE-PATH)/include
$(BASE-PATH)/lib
If dmalloc-support has been enabled, the pre-processor defines
"DEBUG_DMALLOC" and "DMALLOC_FUNC_CHECK" will added to CPPFLAGS
as well as the apropriate "-I" statement.
Use the first define in your source codes to determine whether you
have dmalloc support enabled or not. Usually something like this
will suffice:
#ifdef DEBUG_DMALLOC
# include <dmalloc.h>
#endif
You will find dmalloc at <http://www.dmalloc.com/>.