1 //=-- lsan_linux.cpp ------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file is a part of LeakSanitizer. Linux/NetBSD/Fuchsia-specific code.
11 //===----------------------------------------------------------------------===//
13 #include "sanitizer_common/sanitizer_platform.h"
15 #if SANITIZER_LINUX || SANITIZER_NETBSD || SANITIZER_FUCHSIA
17 # include "lsan_allocator.h"
18 # include "lsan_thread.h"
22 static THREADLOCAL ThreadContextLsanBase
*current_thread
= nullptr;
23 ThreadContextLsanBase
*GetCurrentThread() { return current_thread
; }
24 void SetCurrentThread(ThreadContextLsanBase
*tctx
) { current_thread
= tctx
; }
26 static THREADLOCAL AllocatorCache allocator_cache
;
27 AllocatorCache
*GetAllocatorCache() { return &allocator_cache
; }
29 void ReplaceSystemMalloc() {}
33 #endif // SANITIZER_LINUX || SANITIZER_NETBSD || SANITIZER_FUCHSIA