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

Unified Diff: runtime/vm/heap.cc

Issue 1374373004: Clarify heap write protection interface and use WritableVMIsolateScope to resolve issue 23217. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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/heap.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/heap.cc
diff --git a/runtime/vm/heap.cc b/runtime/vm/heap.cc
index f599742b8eb664c1bd9bebde83b78b84b4c73420..07817e252d5f2d4701b4faf56d23589d323d2970 100644
--- a/runtime/vm/heap.cc
+++ b/runtime/vm/heap.cc
@@ -779,4 +779,16 @@ NoHeapGrowthControlScope::~NoHeapGrowthControlScope() {
heap->SetGrowthControlState(current_growth_controller_state_);
}
+
+WritableVMIsolateScope::WritableVMIsolateScope(Thread* thread)
+ : StackResource(thread) {
+ Dart::vm_isolate()->heap()->WriteProtect(false);
+}
+
+
+WritableVMIsolateScope::~WritableVMIsolateScope() {
+ ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0);
+ Dart::vm_isolate()->heap()->WriteProtect(true);
+}
+
} // namespace dart
« no previous file with comments | « runtime/vm/heap.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698