diff options
-rw-r--r-- | compiler-rt/lib/lsan/lsan_common.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/compiler-rt/lib/lsan/lsan_common.cc b/compiler-rt/lib/lsan/lsan_common.cc index a86d9edfac4..341673fee90 100644 --- a/compiler-rt/lib/lsan/lsan_common.cc +++ b/compiler-rt/lib/lsan/lsan_common.cc @@ -20,14 +20,13 @@ #include "sanitizer_common/sanitizer_stacktrace.h" #include "sanitizer_common/sanitizer_stoptheworld.h" -#if CAN_SANITIZE_LEAKS namespace __lsan { +#if CAN_SANITIZE_LEAKS // This mutex is used to prevent races between DoLeakCheck and SuppressObject. BlockingMutex global_mutex(LINKER_INITIALIZED); THREADLOCAL int disable_counter; -bool DisabledInThisThread() { return disable_counter > 0; } Flags lsan_flags; @@ -401,9 +400,15 @@ void LeakReport::PrintSummary() { "SUMMARY: LeakSanitizer: %zu byte(s) leaked in %zu allocation(s).\n\n", bytes, allocations); } +#endif // CAN_SANITIZE_LEAKS +bool DisabledInThisThread() { +#ifdef CAN_SANITIZE_LEAKS + return disable_counter > 0; +#endif + return false; +} } // namespace __lsan -#endif // CAN_SANITIZE_LEAKS using namespace __lsan; // NOLINT |