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

Unified Diff: runtime/vm/zone.cc

Issue 2609253002: Added isolate + thread high watermark tracking to Observatory (Closed)
Patch Set: Merge branch 'master' of github.com:dart-lang/sdk into resubmit 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
« runtime/vm/thread_registry.cc ('K') | « runtime/vm/thread_test.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 36e962260dd30ed433c67ff89812392ece46ec04..05e7eb75806ab7c1617d0f41e2d558236d39cdee 100644
--- a/runtime/vm/zone.cc
+++ b/runtime/vm/zone.cc
@@ -43,7 +43,13 @@ class Zone::Segment {
void Zone::Segment::DeleteSegmentList(Segment* head) {
Segment* current = head;
+ Thread* current_thread = Thread::Current();
while (current != NULL) {
+ if (current_thread != NULL) {
+ // TODO(bkonyi) Handle special case of segment deletion within native
+ // isolate.
+ current_thread->DecrementMemoryUsage(current->size());
+ }
Segment* next = current->next();
#ifdef DEBUG
// Zap the entire current segment (including the header).
@@ -68,6 +74,11 @@ Zone::Segment* Zone::Segment::New(intptr_t size, Zone::Segment* next) {
#endif
result->next_ = next;
result->size_ = size;
+ if (Thread::Current() != NULL) {
+ // TODO(bkonyi) Handle special case of segment creation within native
+ // isolate.
+ Thread::Current()->IncrementMemoryUsage(size);
+ }
return result;
}
« runtime/vm/thread_registry.cc ('K') | « runtime/vm/thread_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698