2017-03-28 03:42:37 +08:00
|
|
|
//=-- lsan_linux.cc -------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file is a part of LeakSanitizer. Linux-specific code.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2017-03-28 04:22:02 +08:00
|
|
|
#include "sanitizer_common/sanitizer_platform.h"
|
|
|
|
|
2017-03-28 03:42:37 +08:00
|
|
|
#if SANITIZER_LINUX
|
|
|
|
|
|
|
|
#include "lsan_allocator.h"
|
|
|
|
|
|
|
|
namespace __lsan {
|
|
|
|
|
2017-03-30 05:49:47 +08:00
|
|
|
static THREADLOCAL u32 current_thread_tid = kInvalidTid;
|
|
|
|
u32 GetCurrentThread() { return current_thread_tid; }
|
|
|
|
void SetCurrentThread(u32 tid) { current_thread_tid = tid; }
|
|
|
|
|
2017-03-28 03:42:37 +08:00
|
|
|
static THREADLOCAL AllocatorCache allocator_cache;
|
|
|
|
AllocatorCache *GetAllocatorCache() { return &allocator_cache; }
|
|
|
|
|
2017-04-12 04:05:02 +08:00
|
|
|
void ReplaceSystemMalloc() {}
|
|
|
|
|
2017-03-28 03:42:37 +08:00
|
|
|
} // namespace __lsan
|
|
|
|
|
2017-03-28 03:44:11 +08:00
|
|
|
#endif // SANITIZER_LINUX
|