lsan_linux.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132
  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. namespace __lsan {
  16. static THREADLOCAL u32 current_thread_tid = kInvalidTid;
  17. u32 GetCurrentThread() { return current_thread_tid; }
  18. void SetCurrentThread(u32 tid) { current_thread_tid = tid; }
  19. static THREADLOCAL AllocatorCache allocator_cache;
  20. AllocatorCache *GetAllocatorCache() { return &allocator_cache; }
  21. void ReplaceSystemMalloc() {}
  22. } // namespace __lsan
  23. #endif // SANITIZER_LINUX || SANITIZER_NETBSD || SANITIZER_FUCHSIA