diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:17 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:17 +0300 |
commit | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch) | |
tree | dd4bd3ca0f36b817e96812825ffaf10d645803f2 /util/system/valgrind.h | |
parent | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff) | |
download | ydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'util/system/valgrind.h')
-rw-r--r-- | util/system/valgrind.h | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/util/system/valgrind.h b/util/system/valgrind.h index 6cc9e6e575..2ec4ed927c 100644 --- a/util/system/valgrind.h +++ b/util/system/valgrind.h @@ -1,36 +1,36 @@ #pragma once - -#if defined(WITH_VALGRIND) && defined(HAVE_VALGRIND) - #include <valgrind/valgrind.h> - #include <valgrind/memcheck.h> - - #if !defined(VALGRIND_CHECK_READABLE) - #define VALGRIND_CHECK_READABLE(s, l) VALGRIND_CHECK_MEM_IS_DEFINED(s, l) - #endif - - #if !defined(VALGRIND_MAKE_READABLE) - #define VALGRIND_MAKE_READABLE(a, b) VALGRIND_MAKE_MEM_DEFINED(a, b) - #endif -#else - #define RUNNING_ON_VALGRIND 0 - #define VALGRIND_CHECK_READABLE(s, l) - #define VALGRIND_MAKE_READABLE(a, b) 0 - #define VALGRIND_STACK_REGISTER(start, end) 0 - #define VALGRIND_STACK_DEREGISTER(id) - #define VALGRIND_DISCARD(v) ((void)v) -static inline int VALGRIND_PRINTF(...) { - return 0; -} - #define VALGRIND_DO_LEAK_CHECK -#endif + +#if defined(WITH_VALGRIND) && defined(HAVE_VALGRIND) + #include <valgrind/valgrind.h> + #include <valgrind/memcheck.h> + + #if !defined(VALGRIND_CHECK_READABLE) + #define VALGRIND_CHECK_READABLE(s, l) VALGRIND_CHECK_MEM_IS_DEFINED(s, l) + #endif + + #if !defined(VALGRIND_MAKE_READABLE) + #define VALGRIND_MAKE_READABLE(a, b) VALGRIND_MAKE_MEM_DEFINED(a, b) + #endif +#else + #define RUNNING_ON_VALGRIND 0 + #define VALGRIND_CHECK_READABLE(s, l) + #define VALGRIND_MAKE_READABLE(a, b) 0 + #define VALGRIND_STACK_REGISTER(start, end) 0 + #define VALGRIND_STACK_DEREGISTER(id) + #define VALGRIND_DISCARD(v) ((void)v) +static inline int VALGRIND_PRINTF(...) { + return 0; +} + #define VALGRIND_DO_LEAK_CHECK +#endif namespace NValgrind { inline constexpr static bool ValgrindIsOn() noexcept { -#if defined(WITH_VALGRIND) - return true; -#else - return false; -#endif +#if defined(WITH_VALGRIND) + return true; +#else + return false; +#endif } // Returns valgrinded if running under Valgrind and plain otherwise |