lsan_linux.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. //=-- lsan_linux.cpp ------------------------------------------------------===//
  2. //
  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
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This file is a part of LeakSanitizer. Linux/NetBSD/Fuchsia-specific code.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. #include "sanitizer_common/sanitizer_platform.h"
  13. #if SANITIZER_LINUX || SANITIZER_NETBSD || SANITIZER_FUCHSIA
  14. # include "lsan_allocator.h"
  15. # include "lsan_thread.h"
  16. namespace __lsan {
  17. static THREADLOCAL ThreadContextLsanBase *current_thread = nullptr;
  18. ThreadContextLsanBase *GetCurrentThread() { return current_thread; }
  19. void SetCurrentThread(ThreadContextLsanBase *tctx) { current_thread = tctx; }
  20. static THREADLOCAL AllocatorCache allocator_cache;
  21. AllocatorCache *GetAllocatorCache() { return &allocator_cache; }
  22. void ReplaceSystemMalloc() {}
  23. } // namespace __lsan
  24. #endif // SANITIZER_LINUX || SANITIZER_NETBSD || SANITIZER_FUCHSIA