GNU Autoconf, Automake, and Libtool
by Gary V. Vaughan, Ben Elliston, Tom Tromey, Ian Lance Taylor
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'. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access