Once you have ironed out all of the problems in your code with the help of the mpatrol library, there will come a time where you wish to build your program without any of its debugging features, either to improve the speed that it runs at, or perhaps even for a release. Choose one of the following steps to help you remove the mpatrol library from your program (you only need to perform them if you linked your program with the mpatrol library).
NDEBUGpreprocessor macro. This automatically disables the redefinition of
malloc(), etc. and prevents calls being made to any mpatrol library functions. Obviously, this option is the most time-consuming of the two, but will result in the complete removal of all references to the mpatrol library.
HAVE_MPATROL, and then recompiling all of your source code with this macro undefined. This is the best option but relies on you having originally made these changes when you first started integrating the mpatrol library into your program.
Note that if you used the
AM_WITH_MPATROL automake macro as detailed in
the previous section to build your application then you should perform a clean
recompilation using the --without-mpatrol option to the
configure shell script in order to completely remove the mpatrol library.
Note also that if you used the -fcheck-memory-usage option of the GNU compiler to check all memory accesses then you must recompile without that option in order for your program to run at a reasonable speed.