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()23u32 GetCurrentThread() { return current_thread_tid; } SetCurrentThread(u32 tid)24void SetCurrentThread(u32 tid) { current_thread_tid = tid; } 25 26 static THREADLOCAL AllocatorCache allocator_cache; GetAllocatorCache()27AllocatorCache *GetAllocatorCache() { return &allocator_cache; } 28 ReplaceSystemMalloc()29void ReplaceSystemMalloc() {} 30 31 } // namespace __lsan 32 33 #endif // SANITIZER_LINUX 34