Path: blob/main/contrib/llvm-project/compiler-rt/lib/lsan/lsan_posix.h
35233 views
//=-- lsan_posix.h -----------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===---------------------------------------------------------------------===//7//8// This file is a part of LeakSanitizer.9// Standalone LSan RTL code common to POSIX-like systems.10//11//===---------------------------------------------------------------------===//1213#ifndef LSAN_POSIX_H14#define LSAN_POSIX_H1516#include "lsan_thread.h"17#include "sanitizer_common/sanitizer_platform.h"1819#if !SANITIZER_POSIX20#error "lsan_posix.h is used only on POSIX-like systems (SANITIZER_POSIX)"21#endif2223namespace __sanitizer {24struct DTLS;25}2627namespace __lsan {2829class ThreadContext final : public ThreadContextLsanBase {30public:31explicit ThreadContext(int tid);32void OnStarted(void *arg) override;33uptr tls_begin() { return tls_begin_; }34uptr tls_end() { return tls_end_; }35DTLS *dtls() { return dtls_; }3637private:38uptr tls_begin_ = 0;39uptr tls_end_ = 0;40DTLS *dtls_ = nullptr;41};4243void ThreadStart(u32 tid, tid_t os_id,44ThreadType thread_type = ThreadType::Regular);4546} // namespace __lsan4748#endif // LSAN_POSIX_H495051