aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/sanitizers.cpp
diff options
context:
space:
mode:
authorhalin-george <halin-george@yandex-team.ru>2022-02-10 16:50:07 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:07 +0300
commit811c91d683d6123a2aa69baa10b30184f5e1204d (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /util/system/sanitizers.cpp
parent7c7a0655bcf00449b1fcacc2c658cc4d5c3aca7b (diff)
downloadydb-811c91d683d6123a2aa69baa10b30184f5e1204d.tar.gz
Restoring authorship annotation for <halin-george@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/system/sanitizers.cpp')
-rw-r--r--util/system/sanitizers.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/util/system/sanitizers.cpp b/util/system/sanitizers.cpp
index 5fa80de4f1..bb799a9e2e 100644
--- a/util/system/sanitizers.cpp
+++ b/util/system/sanitizers.cpp
@@ -8,17 +8,17 @@ extern "C" {
}
#endif
-#if defined(_tsan_enabled_)
+#if defined(_tsan_enabled_)
#if defined(__clang_major__) && (__clang_major__ >= 9)
-extern "C" {
+extern "C" {
void* __tsan_get_current_fiber(void);
void* __tsan_create_fiber(unsigned flags);
void __tsan_destroy_fiber(void* fiber);
void __tsan_switch_to_fiber(void* fiber, unsigned flags);
void __tsan_set_fiber_name(void* fiber, const char* name);
-}
+}
#else
-namespace {
+namespace {
void* __tsan_get_current_fiber(void) {
return nullptr;
}
@@ -31,43 +31,43 @@ namespace {
}
void __tsan_set_fiber_name(void*, const char*) {
}
-}
+}
#endif
-#endif
-
+#endif
+
using namespace NSan;
TFiberContext::TFiberContext() noexcept
: Token_(nullptr)
, IsMainFiber_(true)
-#if defined(_tsan_enabled_)
- , CurrentTSanFiberContext_(__tsan_get_current_fiber())
-#endif
+#if defined(_tsan_enabled_)
+ , CurrentTSanFiberContext_(__tsan_get_current_fiber())
+#endif
{
TCurrentThreadLimits sl;
Stack_ = sl.StackBegin;
Len_ = sl.StackLength;
-
-#if defined(_tsan_enabled_)
- static constexpr char MainFiberName[] = "main_fiber";
- __tsan_set_fiber_name(CurrentTSanFiberContext_, MainFiberName);
-#endif
+
+#if defined(_tsan_enabled_)
+ static constexpr char MainFiberName[] = "main_fiber";
+ __tsan_set_fiber_name(CurrentTSanFiberContext_, MainFiberName);
+#endif
}
-TFiberContext::TFiberContext(const void* stack, size_t len, const char* contName) noexcept
+TFiberContext::TFiberContext(const void* stack, size_t len, const char* contName) noexcept
: Token_(nullptr)
, Stack_(stack)
, Len_(len)
, IsMainFiber_(false)
-#if defined(_tsan_enabled_)
+#if defined(_tsan_enabled_)
, CurrentTSanFiberContext_(__tsan_create_fiber(/*flags =*/0))
-#endif
+#endif
{
- (void)contName;
-#if defined(_tsan_enabled_)
- __tsan_set_fiber_name(CurrentTSanFiberContext_, contName);
-#endif
+ (void)contName;
+#if defined(_tsan_enabled_)
+ __tsan_set_fiber_name(CurrentTSanFiberContext_, contName);
+#endif
}
TFiberContext::~TFiberContext() noexcept {
@@ -84,10 +84,10 @@ TFiberContext::~TFiberContext() noexcept {
__sanitizer_finish_switch_fiber(activeFakeStack, nullptr, nullptr);
}
#endif
-#if defined(_tsan_enabled_)
- __tsan_destroy_fiber(CurrentTSanFiberContext_);
+#if defined(_tsan_enabled_)
+ __tsan_destroy_fiber(CurrentTSanFiberContext_);
#endif
- }
+ }
}
void TFiberContext::BeforeFinish() noexcept {
@@ -106,10 +106,10 @@ void TFiberContext::BeforeSwitch(TFiberContext* old) noexcept {
#else
(void)old;
#endif
-
-#if defined(_tsan_enabled_)
+
+#if defined(_tsan_enabled_)
__tsan_switch_to_fiber(CurrentTSanFiberContext_, /*flags =*/0);
-#endif
+#endif
}
void TFiberContext::AfterSwitch() noexcept {