1 //=-- lsan_posix.h -----------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===---------------------------------------------------------------------===//
9 // This file is a part of LeakSanitizer.
10 // Standalone LSan RTL code common to POSIX-like systems.
12 //===---------------------------------------------------------------------===//
17 #include "lsan_thread.h"
18 #include "sanitizer_common/sanitizer_platform.h"
21 #error "lsan_posix.h is used only on POSIX-like systems (SANITIZER_POSIX)"
24 namespace __sanitizer
{
30 class ThreadContext final
: public ThreadContextLsanBase
{
32 explicit ThreadContext(int tid
);
33 void OnStarted(void *arg
) override
;
34 uptr
tls_begin() { return tls_begin_
; }
35 uptr
tls_end() { return tls_end_
; }
36 DTLS
*dtls() { return dtls_
; }
41 DTLS
*dtls_
= nullptr;
44 void ThreadStart(u32 tid
, tid_t os_id
,
45 ThreadType thread_type
= ThreadType::Regular
);
49 #endif // LSAN_POSIX_H