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