xref: /netbsd-src/sys/external/bsd/compiler_rt/dist/lib/lsan/lsan_linux.cc (revision a7c257b03e4462df2b1020128fb82716512d7856)
1 //=-- lsan_linux.cc -------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file is a part of LeakSanitizer. Linux-specific code.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "sanitizer_common/sanitizer_platform.h"
15 
16 #if SANITIZER_LINUX
17 
18 #include "lsan_allocator.h"
19 
20 namespace __lsan {
21 
22 static THREADLOCAL u32 current_thread_tid = kInvalidTid;
GetCurrentThread()23 u32 GetCurrentThread() { return current_thread_tid; }
SetCurrentThread(u32 tid)24 void SetCurrentThread(u32 tid) { current_thread_tid = tid; }
25 
26 static THREADLOCAL AllocatorCache allocator_cache;
GetAllocatorCache()27 AllocatorCache *GetAllocatorCache() { return &allocator_cache; }
28 
ReplaceSystemMalloc()29 void ReplaceSystemMalloc() {}
30 
31 } // namespace __lsan
32 
33 #endif // SANITIZER_LINUX
34