2019年2月26日 星期二

Valgrind "client requests" to show the leak summary programmatically

It is useful to show Valgrind leak summary programmatically.

Just add some macros in your code.

#include <valgrind/memcheck.h>

int func()
{
    // ...
    VALGRIND_DO_CHANGED_LEAK_CHECK
    // ...
}

REF: http://valgrind.org/docs/manual/mc-manual.html#mc-manual.clientreqs