24#ifndef DUMUX_VALGRIND_HH
25#define DUMUX_VALGRIND_HH
30bool boolBlubb(
bool value) {
return value; }
33#define SetUndefined(t) voidBlubb()
34#define SetDefined(t) voidBlubb()
35#define CheckDefined(t) boolBlubb(true)
36#define SetNoAccess(t) voidBlubb()
37#define Running() boolBlubb(false)
41#include <valgrind/memcheck.h>
51#if !defined NDEBUG && HAVE_VALGRIND
52 return RUNNING_ON_VALGRIND;
74#if !defined NDEBUG && HAVE_VALGRIND
75 unsigned int tmp = VALGRIND_CHECK_MEM_IS_DEFINED(&value,
sizeof(T));
85#if !defined NDEBUG && HAVE_VALGRIND
86 unsigned int tmp = VALGRIND_CHECK_MEM_IS_DEFINED(value, size*
sizeof(T));
104#if !defined NDEBUG && HAVE_VALGRIND
105 VALGRIND_MAKE_MEM_UNDEFINED(&value,
sizeof(T));
112#if !defined NDEBUG && HAVE_VALGRIND
113 VALGRIND_MAKE_MEM_UNDEFINED(value, size*
sizeof(T));
128#if !defined NDEBUG && HAVE_VALGRIND
129 VALGRIND_MAKE_MEM_DEFINED(&value,
sizeof(T));
136#if !defined NDEBUG && HAVE_VALGRIND
137 VALGRIND_MAKE_MEM_DEFINED(value, n*
sizeof(T));
152#if !defined NDEBUG && HAVE_VALGRIND
153 VALGRIND_MAKE_MEM_NOACCESS(&value,
sizeof(T));
160#if !defined NDEBUG && HAVE_VALGRIND
161 VALGRIND_MAKE_MEM_NOACCESS(value, n*
sizeof(T));
bool CheckDefined(const T &value)
Make valgrind complain if the object occupied by an object is undefined.
Definition: valgrind.hh:72
bool Running()
Returns whether the program is running under Valgrind or not.
Definition: valgrind.hh:49
void SetDefined(const T &value)
Make the memory on which an object resides defined.
Definition: valgrind.hh:126
void SetUndefined(const T &value)
Make the memory on which an object resides undefined.
Definition: valgrind.hh:102
void SetNoAccess(const T &value)
Make valgrind complain if an object's memory is accessed.
Definition: valgrind.hh:150
Definition: valgrind.hh:44