19.4. Integrating Dmalloc

Mismanagement of memory causes a huge number of bugs in C and C++ code. Using the wrapper functions described earlier (see the section "Memory Management" in Section 7.2.1, "Portability Infrastructure" ), or their equivalent can help immensely in reducing the occurrence of such bugs. Ultimately, you will introduce a difficult-to-diagnose memory bug despite these measures.

That is where Dmalloc[3] comes in. I recommend using it routinely in all your projects; you will find all sorts of leaks and bugs that might otherwise have lain dormant for some time. Automake has explicit support for Dmalloc to make using it in your own projects as painless as possible. The first step is to add the macro 'AM_WITH_DMALLOC' to 'configure.in'. ...

Get GNU Autoconf, Automake, and Libtool now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.