[ELF] Reorder SectionBase/InputSectionBase members
[llvm-project.git] / compiler-rt / lib / hwasan / hwasan_thread_list.cpp
blob794cfb7550d77e82d2c5295bc492a67b15918eda
1 #include "hwasan_thread_list.h"
3 #include "sanitizer_common/sanitizer_placement_new.h"
4 #include "sanitizer_common/sanitizer_thread_arg_retval.h"
6 namespace __hwasan {
8 static HwasanThreadList *hwasan_thread_list;
9 static ThreadArgRetval *thread_data;
11 HwasanThreadList &hwasanThreadList() { return *hwasan_thread_list; }
12 ThreadArgRetval &hwasanThreadArgRetval() { return *thread_data; }
14 void InitThreadList(uptr storage, uptr size) {
15 CHECK_EQ(hwasan_thread_list, nullptr);
17 alignas(alignof(HwasanThreadList)) static char
18 thread_list_placeholder[sizeof(HwasanThreadList)];
19 hwasan_thread_list =
20 new (thread_list_placeholder) HwasanThreadList(storage, size);
22 CHECK_EQ(thread_data, nullptr);
24 alignas(alignof(ThreadArgRetval)) static char
25 thread_data_placeholder[sizeof(ThreadArgRetval)];
26 thread_data = new (thread_data_placeholder) ThreadArgRetval();
29 } // namespace __hwasan