aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/thread.cpp
diff options
context:
space:
mode:
authorsomov <somov@yandex-team.ru>2022-02-10 16:45:49 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:49 +0300
commit7489e4682331202b9c7d863c0898eb83d7b12c2b (patch)
tree9142afc54d335ea52910662635b898e79e192e49 /util/system/thread.cpp
parenta5950576e397b1909261050b8c7da16db58f10b1 (diff)
downloadydb-7489e4682331202b9c7d863c0898eb83d7b12c2b.tar.gz
Restoring authorship annotation for <somov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/system/thread.cpp')
-rw-r--r--util/system/thread.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/util/system/thread.cpp b/util/system/thread.cpp
index f10d79113f..6236746c2d 100644
--- a/util/system/thread.cpp
+++ b/util/system/thread.cpp
@@ -530,27 +530,27 @@ TCurrentThreadLimits::TCurrentThreadLimits() noexcept
StackBegin = pthread_get_stackaddr_np(pthread_self());
StackLength = pthread_get_stacksize_np(pthread_self());
#elif defined(_MSC_VER)
-
+
#if _WIN32_WINNT >= _WIN32_WINNT_WIN8
ULONG_PTR b = 0;
ULONG_PTR e = 0;
- GetCurrentThreadStackLimits(&b, &e);
+ GetCurrentThreadStackLimits(&b, &e);
StackBegin = (const void*)b;
StackLength = e - b;
-
+
#else
- // Copied from https://github.com/llvm-mirror/compiler-rt/blob/release_40/lib/sanitizer_common/sanitizer_win.cc#L91
- void* place_on_stack = alloca(16);
- MEMORY_BASIC_INFORMATION memory_info;
- Y_VERIFY(VirtualQuery(place_on_stack, &memory_info, sizeof(memory_info)));
-
- StackBegin = memory_info.AllocationBase;
- StackLength = static_cast<const char*>(memory_info.BaseAddress) + memory_info.RegionSize - static_cast<const char*>(StackBegin);
-
+ // Copied from https://github.com/llvm-mirror/compiler-rt/blob/release_40/lib/sanitizer_common/sanitizer_win.cc#L91
+ void* place_on_stack = alloca(16);
+ MEMORY_BASIC_INFORMATION memory_info;
+ Y_VERIFY(VirtualQuery(place_on_stack, &memory_info, sizeof(memory_info)));
+
+ StackBegin = memory_info.AllocationBase;
+ StackLength = static_cast<const char*>(memory_info.BaseAddress) + memory_info.RegionSize - static_cast<const char*>(StackBegin);
+
#endif
-
+
#else
#error port me
#endif