1 #include "hwasan_thread_list.h"
3 #include "sanitizer_common/sanitizer_placement_new.h"
4 #include "sanitizer_common/sanitizer_thread_arg_retval.h"
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
)];
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