Index: src/compiler/zone-pool.cc |
diff --git a/src/compiler/zone-pool.cc b/src/compiler/zone-pool.cc |
index 8276023522962e01762e0dd6e85b8ac0469391ab..179988d418f15a469b775a26a2d72065f2a4ad72 100644 |
--- a/src/compiler/zone-pool.cc |
+++ b/src/compiler/zone-pool.cc |
@@ -9,7 +9,9 @@ namespace internal { |
namespace compiler { |
ZonePool::StatsScope::StatsScope(ZonePool* zone_pool) |
- : zone_pool_(zone_pool), max_allocated_bytes_(0) { |
+ : zone_pool_(zone_pool), |
+ total_allocated_bytes_at_start_(zone_pool->GetTotalAllocatedBytes()), |
+ max_allocated_bytes_(0) { |
zone_pool_->stats_.push_back(this); |
for (auto zone : zone_pool_->used_) { |
size_t size = static_cast<size_t>(zone->allocation_size()); |
@@ -46,6 +48,11 @@ size_t ZonePool::StatsScope::GetCurrentAllocatedBytes() { |
} |
+size_t ZonePool::StatsScope::GetTotalAllocatedBytes() { |
+ return zone_pool_->GetTotalAllocatedBytes() - total_allocated_bytes_at_start_; |
+} |
+ |
+ |
void ZonePool::StatsScope::ZoneReturned(Zone* zone) { |
size_t current_total = GetCurrentAllocatedBytes(); |
// Update max. |