summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/scudo/standalone/secondary.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/scudo/standalone/secondary.cpp')
-rw-r--r--compiler-rt/lib/scudo/standalone/secondary.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/compiler-rt/lib/scudo/standalone/secondary.cpp b/compiler-rt/lib/scudo/standalone/secondary.cpp
index d725034ee91..db7361d7134 100644
--- a/compiler-rt/lib/scudo/standalone/secondary.cpp
+++ b/compiler-rt/lib/scudo/standalone/secondary.cpp
@@ -123,12 +123,13 @@ void MapAllocator::deallocate(void *Ptr) {
unmap(Addr, Size, UNMAP_ALL, &Data);
}
-void MapAllocator::printStats() const {
- Printf("Stats: MapAllocator: allocated %zu times (%zuK), freed %zu times "
- "(%zuK), remains %zu (%zuK) max %zuM\n",
- NumberOfAllocs, AllocatedBytes >> 10, NumberOfFrees, FreedBytes >> 10,
- NumberOfAllocs - NumberOfFrees, (AllocatedBytes - FreedBytes) >> 10,
- LargestSize >> 20);
+void MapAllocator::getStats(ScopedString *Str) const {
+ Str->append(
+ "Stats: MapAllocator: allocated %zu times (%zuK), freed %zu times "
+ "(%zuK), remains %zu (%zuK) max %zuM\n",
+ NumberOfAllocs, AllocatedBytes >> 10, NumberOfFrees, FreedBytes >> 10,
+ NumberOfAllocs - NumberOfFrees, (AllocatedBytes - FreedBytes) >> 10,
+ LargestSize >> 20);
}
} // namespace scudo
OpenPOWER on IntegriCloud