Add support for the dmalloc memory checking tool.
@tanuk
Submitted by Tanu Kaskinen Assigned to pul..@..op.org
Description
The dmalloc (http://dmalloc.com/) tool is somewhat useful tool for checking memory issues. Valgrind is probably "better", but it slows things down too much in some environments.
The level of "support" I'd like to have in Pulseaudio is just including dmalloc.h in pulse/xmalloc.c if HAVE_DMALLOC is defined. This is pretty useless for tracking down memory leaks, because dmalloc only reports the immediate caller of malloc(), which in case of Pulseaudio will always be pa_xmalloc(). There are checks for other errors than memory leaks, so dmalloc can still be useful.
So, what needs to be done is adding this to pulse/xmalloc.c:
#ifdef HAVE_DMALLOC #include <dmalloc.h> #endif
In addition to that, Makefile.am of course needs some adjustment, and I'd like to have --enable-dmalloc switch in the configure script.
Note that linking libdmallocth into libpulse requires dmalloc to be built with -fPIC. That isn't enabled by default in dmalloc's build system, so this needs to be mentioned in "configure --help" for the --enable-dmalloc switch. It would be nice to check in the configure script whether the installed libdmallocth.a is built with -fPIC, but I don't know how that can be done, or whether it's even possible.