Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2929)

Unified Diff: runtime/vm/zone.cc

Issue 2656903004: Fixed issue where initial 1KB zone buffer was not being accounted for when tracking thread zone mem… (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/thread.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « runtime/vm/thread.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698