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

Unified Diff: runtime/vm/pages.cc

Issue 2993383002: [vm] Compute per-HeapPage usage during sweeping. (Closed)
Patch Set: Created 3 years, 4 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/pages.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/pages.cc
diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc
index 0ece9f17e7b59b65fe5d0f3c6851010ed6766549..4fe574528cff94891fd3508661113820b58f04d5 100644
--- a/runtime/vm/pages.cc
+++ b/runtime/vm/pages.cc
@@ -71,6 +71,7 @@ HeapPage* HeapPage::Initialize(VirtualMemory* memory,
ASSERT(result != NULL);
result->memory_ = memory;
result->next_ = NULL;
+ result->used_in_bytes_ = 0;
result->type_ = type;
LSAN_REGISTER_ROOT_REGION(result, sizeof(*result));
@@ -1092,6 +1093,7 @@ void PageSpace::SetupImagePage(void* pointer, uword size, bool is_executable) {
page->memory_ = memory;
page->next_ = NULL;
page->object_end_ = memory->end();
+ page->used_in_bytes_ = page->object_end_ - page->object_start();
MutexLocker ml(pages_lock_);
HeapPage **first, **tail;
« no previous file with comments | « runtime/vm/pages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698