|
From: Nicholas N. <nj...@cs...> - 2005-10-15 16:50:21
|
On Thu, 13 Oct 2005, Jaskaran Singh wrote: > Does valgrind provide a means of selectively turning heap checking ON > and OFF programmatically ? > > Something like: > > HeapChecker.start(); > doSomething(); > HeapChecker.stop(); > > so that the generated report contains leaks, if any, in doSomething(); I > am looking to integrate valgrind with my unit test framework but I do > not want the complete test harness to run under valgrind as that can be > prohibitive. You can invoke the leak checker at any time by using the VALGRIND_DO_LEAK_CHECK and VALGRIND_COUNT_LEAKS client requests. See 3.7 in the manual. --- On this note: we regularly get questions like this from Valgrind users who want to use Valgrind for unit testing. It would be great to have something in the manual and/or the FAQ about how to set this up. If someone who has set up such a system is willing to write a short description of how it works, that would be very useful. Nick |