[compiler-rt] r185805 - [LSan] Use overridable hook to report error summary
Alexey Samsonov
samsonov at google.com
Mon Jul 8 03:59:52 PDT 2013
Author: samsonov
Date: Mon Jul 8 05:59:52 2013
New Revision: 185805
URL: http://llvm.org/viewvc/llvm-project?rev=185805&view=rev
Log:
[LSan] Use overridable hook to report error summary
Modified:
compiler-rt/trunk/lib/lsan/lsan_common.cc
Modified: compiler-rt/trunk/lib/lsan/lsan_common.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lsan_common.cc?rev=185805&r1=185804&r2=185805&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/lsan_common.cc (original)
+++ compiler-rt/trunk/lib/lsan/lsan_common.cc Mon Jul 8 05:59:52 2013
@@ -480,9 +480,12 @@ void LeakReport::PrintSummary() {
bytes += leaks_[i].total_size;
allocations += leaks_[i].hit_count;
}
- Printf(
- "SUMMARY: LeakSanitizer: %zu byte(s) leaked in %zu allocation(s).\n\n",
- bytes, allocations);
+ const int kMaxSummaryLength = 128;
+ InternalScopedBuffer<char> summary(kMaxSummaryLength);
+ internal_snprintf(summary.data(), kMaxSummaryLength,
+ "LeakSanitizer: %zu byte(s) leaked in %zu allocation(s).",
+ bytes, allocations);
+ __sanitizer_report_error_summary(summary.data());
}
uptr LeakReport::ApplySuppressions() {
More information about the llvm-commits
mailing list