From 78a30208d86b2fbfed602e7798a93b6b366001bd Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Sat, 14 Dec 2013 12:03:44 +0100 Subject: [PATCH] simplify the valgrind client request helpers the macros where used to make the influence of the valgrind calls zero even for debug builds if valgrind client requests were unavailable. Since this resulted in some inconsistencies, and the performance hit is not terribly large, we now always use the same inlined functions. For optimized builds the impact of those is still zero... --- opm/material/Valgrind.hpp | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/opm/material/Valgrind.hpp b/opm/material/Valgrind.hpp index 5816a1554..73a316be6 100644 --- a/opm/material/Valgrind.hpp +++ b/opm/material/Valgrind.hpp @@ -20,29 +20,16 @@ */ /*! * \file - * \brief Some templates to wrap the valgrind macros + * \brief Some templates to wrap the valgrind client request macros */ #ifndef OPM_VALGRIND_HPP #define OPM_VALGRIND_HPP #include -#if ! HAVE_VALGRIND && ! defined(DOXYGEN) -namespace Valgrind -{ -inline bool boolBlubb(bool value) { return value; } -inline void voidBlubb() { } - -#define SetUndefined(t) voidBlubb() -#define SetDefined(t) voidBlubb() -#define CheckDefined(t) boolBlubb(true) -#define SetNoAccess(t) voidBlubb() -#define IsRunning() boolBlubb(false) -} // namespace Valgrind - -#else - +#if HAVE_VALGRIND #include +#endif namespace Valgrind { @@ -59,7 +46,6 @@ inline bool IsRunning() #endif } - /*! * \ingroup Valgrind * \brief Make valgrind complain if any of the memory occupied by an object @@ -94,10 +80,10 @@ inline bool CheckDefined(const T &value) return true; #endif } + /*! * \ingroup Valgrind - * - * * \brief Make valgrind complain if any of the the memory occupied + * \brief Make valgrind complain if any of the the memory occupied * by a C-style array objects is undefined. * * Please note that this does not check whether the destinations of an @@ -285,5 +271,3 @@ inline void SetNoAccess(const T *value, int size) } // namespace Valgrind #endif - -#endif