]> git.ipfire.org Git - thirdparty/gcc.git/blame - libsanitizer/lsan/lsan_linux.cpp
Libsanitizer: merge from master.
[thirdparty/gcc.git] / libsanitizer / lsan / lsan_linux.cpp
CommitLineData
b667dd70 1//=-- lsan_linux.cpp ------------------------------------------------------===//
5d3805fc 2//
b667dd70
ML
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
5d3805fc
JJ
6//
7//===----------------------------------------------------------------------===//
8//
3c6331c2 9// This file is a part of LeakSanitizer. Linux/NetBSD/Fuchsia-specific code.
5d3805fc
JJ
10//
11//===----------------------------------------------------------------------===//
12
13#include "sanitizer_common/sanitizer_platform.h"
14
3c6331c2 15#if SANITIZER_LINUX || SANITIZER_NETBSD || SANITIZER_FUCHSIA
5d3805fc
JJ
16
17#include "lsan_allocator.h"
18
19namespace __lsan {
20
21static THREADLOCAL u32 current_thread_tid = kInvalidTid;
22u32 GetCurrentThread() { return current_thread_tid; }
23void SetCurrentThread(u32 tid) { current_thread_tid = tid; }
24
25static THREADLOCAL AllocatorCache allocator_cache;
26AllocatorCache *GetAllocatorCache() { return &allocator_cache; }
27
28void ReplaceSystemMalloc() {}
29
30} // namespace __lsan
31
3c6331c2 32#endif // SANITIZER_LINUX || SANITIZER_NETBSD || SANITIZER_FUCHSIA