xref: /openbsd-src/gnu/llvm/compiler-rt/lib/lsan/lsan_linux.cpp (revision 1f9cb04fc6f537ca6cf5a53c28927340cba218a2)
13cab2bb3Spatrick //=-- lsan_linux.cpp ------------------------------------------------------===//
23cab2bb3Spatrick //
33cab2bb3Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
43cab2bb3Spatrick // See https://llvm.org/LICENSE.txt for license information.
53cab2bb3Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
63cab2bb3Spatrick //
73cab2bb3Spatrick //===----------------------------------------------------------------------===//
83cab2bb3Spatrick //
9*1f9cb04fSpatrick // This file is a part of LeakSanitizer. Linux/NetBSD/Fuchsia-specific code.
103cab2bb3Spatrick //
113cab2bb3Spatrick //===----------------------------------------------------------------------===//
123cab2bb3Spatrick 
133cab2bb3Spatrick #include "sanitizer_common/sanitizer_platform.h"
143cab2bb3Spatrick 
15*1f9cb04fSpatrick #if SANITIZER_LINUX || SANITIZER_NETBSD || SANITIZER_FUCHSIA
163cab2bb3Spatrick 
173cab2bb3Spatrick #include "lsan_allocator.h"
183cab2bb3Spatrick 
193cab2bb3Spatrick namespace __lsan {
203cab2bb3Spatrick 
213cab2bb3Spatrick static THREADLOCAL u32 current_thread_tid = kInvalidTid;
GetCurrentThread()223cab2bb3Spatrick u32 GetCurrentThread() { return current_thread_tid; }
SetCurrentThread(u32 tid)233cab2bb3Spatrick void SetCurrentThread(u32 tid) { current_thread_tid = tid; }
243cab2bb3Spatrick 
253cab2bb3Spatrick static THREADLOCAL AllocatorCache allocator_cache;
GetAllocatorCache()263cab2bb3Spatrick AllocatorCache *GetAllocatorCache() { return &allocator_cache; }
273cab2bb3Spatrick 
ReplaceSystemMalloc()283cab2bb3Spatrick void ReplaceSystemMalloc() {}
293cab2bb3Spatrick 
303cab2bb3Spatrick } // namespace __lsan
313cab2bb3Spatrick 
32*1f9cb04fSpatrick #endif  // SANITIZER_LINUX || SANITIZER_NETBSD || SANITIZER_FUCHSIA
33