libstdc++: Use variable template to fix -fconcepts-ts error [PR113366]
[official-gcc.git] / libsanitizer / hwasan / hwasan_thread_list.cpp
blob7df4dd3d7851811ad01ce749aa375ed7af6f1feb
1 #include "hwasan_thread_list.h"
3 #include "sanitizer_common/sanitizer_thread_arg_retval.h"
5 namespace __hwasan {
7 static HwasanThreadList *hwasan_thread_list;
8 static ThreadArgRetval *thread_data;
10 HwasanThreadList &hwasanThreadList() { return *hwasan_thread_list; }
11 ThreadArgRetval &hwasanThreadArgRetval() { return *thread_data; }
13 void InitThreadList(uptr storage, uptr size) {
14 CHECK_EQ(hwasan_thread_list, nullptr);
16 static ALIGNED(alignof(
17 HwasanThreadList)) char thread_list_placeholder[sizeof(HwasanThreadList)];
18 hwasan_thread_list =
19 new (thread_list_placeholder) HwasanThreadList(storage, size);
21 CHECK_EQ(thread_data, nullptr);
23 static ALIGNED(alignof(
24 ThreadArgRetval)) char thread_data_placeholder[sizeof(ThreadArgRetval)];
25 thread_data = new (thread_data_placeholder) ThreadArgRetval();
28 } // namespace __hwasan