Path: blob/main/contrib/llvm-project/compiler-rt/lib/lsan/lsan_linux.cpp
35233 views
//=-- lsan_linux.cpp ------------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file is a part of LeakSanitizer. Linux/NetBSD/Fuchsia-specific code.9//10//===----------------------------------------------------------------------===//1112#include "sanitizer_common/sanitizer_platform.h"1314#if SANITIZER_LINUX || SANITIZER_NETBSD || SANITIZER_FUCHSIA1516# include "lsan_allocator.h"17# include "lsan_thread.h"1819namespace __lsan {2021static THREADLOCAL ThreadContextLsanBase *current_thread = nullptr;22ThreadContextLsanBase *GetCurrentThread() { return current_thread; }23void SetCurrentThread(ThreadContextLsanBase *tctx) { current_thread = tctx; }2425static THREADLOCAL AllocatorCache allocator_cache;26AllocatorCache *GetAllocatorCache() { return &allocator_cache; }2728void ReplaceSystemMalloc() {}2930} // namespace __lsan3132#endif // SANITIZER_LINUX || SANITIZER_NETBSD || SANITIZER_FUCHSIA333435