[lsan] Fix win build.

llvm-svn: 184555
This commit is contained in:
Sergey Matveev 2013-06-21 15:14:57 +00:00
parent d28c03c03a
commit 7ed5c687ed
1 changed files with 9 additions and 4 deletions

View File

@ -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,10 +400,16 @@ void LeakReport::PrintSummary() {
"SUMMARY: LeakSanitizer: %zu byte(s) leaked in %zu allocation(s).\n\n",
bytes, allocations);
}
} // namespace __lsan
#endif // CAN_SANITIZE_LEAKS
bool DisabledInThisThread() {
#ifdef CAN_SANITIZE_LEAKS
return disable_counter > 0;
#endif
return false;
}
} // namespace __lsan
using namespace __lsan; // NOLINT
extern "C" {