Index: runtime/vm/zone.cc |
diff --git a/runtime/vm/zone.cc b/runtime/vm/zone.cc |
index 05e7eb75806ab7c1617d0f41e2d558236d39cdee..2925798efa2269462c21fdc5a9cc6d468086be89 100644 |
--- a/runtime/vm/zone.cc |
+++ b/runtime/vm/zone.cc |
@@ -92,6 +92,10 @@ Zone::Zone() |
handles_(), |
previous_(NULL) { |
ASSERT(Utils::IsAligned(position_, kAlignment)); |
+ Thread* current = Thread::Current(); |
+ if (current != NULL) { |
+ current->IncrementMemoryUsage(kInitialChunkSize); |
+ } |
#ifdef DEBUG |
// Zap the entire initial buffer. |
memset(initial_buffer_.pointer(), kZapUninitializedByte, |
@@ -104,6 +108,10 @@ Zone::~Zone() { |
if (FLAG_trace_zones) { |
DumpZoneSizes(); |
} |
+ Thread* current = Thread::Current(); |
+ if (current != NULL) { |
+ current->DecrementMemoryUsage(kInitialChunkSize); |
+ } |
DeleteAll(); |
} |