diff options
author | asatarin <[email protected]> | 2022-02-10 16:47:30 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:47:30 +0300 |
commit | ca04a556317a80ac802f38457a2292185282878b (patch) | |
tree | c0748b5dcbade83af788c0abfa89c0383d6b779c /util | |
parent | 4ca29390ac54b7877174de542de47532c67453b5 (diff) |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'util')
-rw-r--r-- | util/system/sanitizers.h | 38 | ||||
-rw-r--r-- | util/system/valgrind.h | 36 |
2 files changed, 37 insertions, 37 deletions
diff --git a/util/system/sanitizers.h b/util/system/sanitizers.h index 1946148d2cd..965e5c751e4 100644 --- a/util/system/sanitizers.h +++ b/util/system/sanitizers.h @@ -1,7 +1,7 @@ #pragma once #include "defaults.h" - + extern "C" { // sanitizers API #if defined(_asan_enabled_) @@ -12,8 +12,8 @@ extern "C" { // sanitizers API void __msan_unpoison(const volatile void* a, size_t size); void __msan_poison(const volatile void* a, size_t size); void __msan_check_mem_is_initialized(const volatile void* x, size_t size); -#endif - +#endif + }; // sanitizers API namespace NSan { @@ -21,7 +21,7 @@ namespace NSan { public: TFiberContext() noexcept; TFiberContext(const void* stack, size_t len, const char* contName) noexcept; - + ~TFiberContext() noexcept; void BeforeFinish() noexcept; @@ -41,19 +41,19 @@ namespace NSan { #endif }; - // Returns plain if no sanitizer enabled or sanitized otherwise - // Ment to be used in test code for constants (timeouts, etc) - template <typename T> - inline constexpr static T PlainOrUnderSanitizer(T plain, T sanitized) noexcept { -#if defined(_tsan_enabled_) || defined(_msan_enabled_) || defined(_asan_enabled_) - Y_UNUSED(plain); - return sanitized; -#else - Y_UNUSED(sanitized); - return plain; -#endif - } - + // Returns plain if no sanitizer enabled or sanitized otherwise + // Ment to be used in test code for constants (timeouts, etc) + template <typename T> + inline constexpr static T PlainOrUnderSanitizer(T plain, T sanitized) noexcept { +#if defined(_tsan_enabled_) || defined(_msan_enabled_) || defined(_asan_enabled_) + Y_UNUSED(plain); + return sanitized; +#else + Y_UNUSED(sanitized); + return plain; +#endif + } + // Determines if asan present inline constexpr static bool ASanIsOn() noexcept { #if defined(_asan_enabled_) @@ -106,10 +106,10 @@ namespace NSan { inline static void CheckMemIsInitialized(const volatile void* a, size_t size) noexcept { #if defined(_msan_enabled_) __msan_check_mem_is_initialized(a, size); -#else +#else Y_UNUSED(a); Y_UNUSED(size); -#endif +#endif } inline static void MarkAsIntentionallyLeaked(const void* ptr) noexcept { diff --git a/util/system/valgrind.h b/util/system/valgrind.h index 317350d3442..2ec4ed927ca 100644 --- a/util/system/valgrind.h +++ b/util/system/valgrind.h @@ -23,26 +23,26 @@ static inline int VALGRIND_PRINTF(...) { } #define VALGRIND_DO_LEAK_CHECK #endif - -namespace NValgrind { - inline constexpr static bool ValgrindIsOn() noexcept { + +namespace NValgrind { + inline constexpr static bool ValgrindIsOn() noexcept { #if defined(WITH_VALGRIND) return true; #else return false; #endif - } - - // Returns valgrinded if running under Valgrind and plain otherwise - // Ment to be used in test code for constants (timeouts, etc) - template <typename T> - inline constexpr static T PlainOrUnderValgrind(T plain, T valgrinded) noexcept { -#if defined(WITH_VALGRIND) - Y_UNUSED(plain); - return valgrinded; -#else - Y_UNUSED(valgrinded); - return plain; -#endif - } -} + } + + // Returns valgrinded if running under Valgrind and plain otherwise + // Ment to be used in test code for constants (timeouts, etc) + template <typename T> + inline constexpr static T PlainOrUnderValgrind(T plain, T valgrinded) noexcept { +#if defined(WITH_VALGRIND) + Y_UNUSED(plain); + return valgrinded; +#else + Y_UNUSED(valgrinded); + return plain; +#endif + } +} |