2019-08-01 22:01:30 +08:00
|
|
|
//=-- lsan_linux.cpp ------------------------------------------------------===//
|
2017-03-28 03:42:37 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2017-03-28 03:42:37 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2020-01-28 16:24:41 +08:00
|
|
|
// This file is a part of LeakSanitizer. Linux/NetBSD-specific code.
|
2017-03-28 03:42:37 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2017-03-28 04:22:02 +08:00
|
|
|
#include "sanitizer_common/sanitizer_platform.h"
|
|
|
|
|
2020-01-28 16:24:41 +08:00
|
|
|
#if SANITIZER_LINUX || SANITIZER_NETBSD
|
2017-03-28 03:42:37 +08:00
|
|
|
|
|
|
|
#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
|
|
|
|
|
2020-01-28 16:24:41 +08:00
|
|
|
#endif // SANITIZER_LINUX || SANITIZER_NETBSD
|