25 #ifndef OPM_VALGRIND_HPP
26 #define OPM_VALGRIND_HPP
31 #include <valgrind/memcheck.h>
42 #if !defined NDEBUG && HAVE_VALGRIND
43 return RUNNING_ON_VALGRIND;
76 #if !defined NDEBUG && HAVE_VALGRIND
77 auto tmp = VALGRIND_CHECK_MEM_IS_DEFINED(&value,
sizeof(T));
112 #if !defined NDEBUG && HAVE_VALGRIND
113 auto tmp = VALGRIND_CHECK_MEM_IS_DEFINED(value, size*
sizeof(T));
140 #if !defined NDEBUG && HAVE_VALGRIND
141 auto OPM_UNUSED result = VALGRIND_MAKE_MEM_UNDEFINED(&value,
sizeof(T));
166 #if !defined NDEBUG && HAVE_VALGRIND
167 auto OPM_UNUSED result = VALGRIND_MAKE_MEM_UNDEFINED(value, size*
sizeof(T));
190 #if !defined NDEBUG && HAVE_VALGRIND
191 auto OPM_UNUSED result = VALGRIND_MAKE_MEM_DEFINED(&value,
sizeof(T));
216 #if !defined NDEBUG && HAVE_VALGRIND
217 auto OPM_UNUSED result = VALGRIND_MAKE_MEM_DEFINED(value, n*
sizeof(T));
240 #if !defined NDEBUG && HAVE_VALGRIND
241 auto OPM_UNUSED result = VALGRIND_MAKE_MEM_NOACCESS(&value,
sizeof(T));
264 #if !defined NDEBUG && HAVE_VALGRIND
265 auto OPM_UNUSED result = VALGRIND_MAKE_MEM_NOACCESS(value, size*
sizeof(T));
void SetUndefined(const T &value OPM_UNUSED)
Make the memory on which an object resides undefined in valgrind runs.
Definition: Valgrind.hpp:138
bool CheckDefined(const T &value OPM_UNUSED)
Make valgrind complain if any of the memory occupied by an object is undefined.
Definition: Valgrind.hpp:74
void SetNoAccess(const T &value OPM_UNUSED)
Make valgrind complain if an object's memory is accessed.
Definition: Valgrind.hpp:238
Definition: Valgrind.hpp:34
bool IsRunning()
Returns whether the program is running under Valgrind or not.
Definition: Valgrind.hpp:40
#define OPM_UNUSED
Definition: Unused.hpp:32
void SetDefined(const T &value OPM_UNUSED)
Make the memory on which an object resides defined.
Definition: Valgrind.hpp:188
Provides the OPM_UNUSED macro.