summaryrefslogtreecommitdiff
path: root/compiler-rt
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2023-05-08 11:03:40 -0700
committerVitaly Buka <vitalybuka@google.com>2023-05-08 16:33:29 -0700
commit15593613769f767e78310b08e57b0a93dda6643e (patch)
tree2fb5e7e4b99368b00029ba4cbaeb689cf1ebdd60 /compiler-rt
parentf4999d3535af93919d58e3cc56ccb50f2ccb8453 (diff)
downloadllvm-15593613769f767e78310b08e57b0a93dda6643e.tar.gz
[NFC][ASAN] Hide placeholder buffer
Diffstat (limited to 'compiler-rt')
-rw-r--r--compiler-rt/lib/asan/asan_thread.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler-rt/lib/asan/asan_thread.cpp b/compiler-rt/lib/asan/asan_thread.cpp
index 8d4b5c80f76e..a1734a6f896d 100644
--- a/compiler-rt/lib/asan/asan_thread.cpp
+++ b/compiler-rt/lib/asan/asan_thread.cpp
@@ -40,11 +40,7 @@ void AsanThreadContext::OnFinished() {
thread = nullptr;
}
-// MIPS requires aligned address
-static ALIGNED(alignof(
- ThreadRegistry)) char thread_registry_placeholder[sizeof(ThreadRegistry)];
static ThreadRegistry *asan_thread_registry;
-
static Mutex mu_for_thread_context;
static LowLevelAllocator allocator_for_thread_context;
@@ -63,6 +59,11 @@ static void InitThreads() {
// in TSD and can't reliably tell when no more TSD destructors will
// be called. It would be wrong to reuse AsanThreadContext for another
// thread before all TSD destructors will be called for it.
+
+ // MIPS requires aligned address
+ static ALIGNED(alignof(
+ ThreadRegistry)) char thread_registry_placeholder[sizeof(ThreadRegistry)];
+
asan_thread_registry =
new (thread_registry_placeholder) ThreadRegistry(GetAsanThreadContext);
initialized = true;