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

Unified Diff: runtime/vm/heap.h

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 | « no previous file | runtime/vm/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/heap.h
diff --git a/runtime/vm/heap.h b/runtime/vm/heap.h
index 8feb555470ab0364177434828d2c6fdbf1ce5740..496a9c8ef049af3ffc2956ddc883a4a1a9536a60 100644
--- a/runtime/vm/heap.h
+++ b/runtime/vm/heap.h
@@ -133,7 +133,8 @@ class Heap {
void SetGrowthControlState(bool state);
bool GrowthControlState();
- // Protect access to the heap.
+ // Protect access to the heap. Note: Code pages are made
+ // executable/non-executable when 'read_only' is true/false, respectively.
void WriteProtect(bool read_only);
void WriteProtectCode(bool read_only) {
old_space_.WriteProtectCode(read_only);
@@ -358,6 +359,14 @@ class NoHeapGrowthControlScope : public StackResource {
DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope);
};
+
+// Note: During this scope, the code pages are non-executable.
+class WritableVMIsolateScope : StackResource {
+ public:
+ explicit WritableVMIsolateScope(Thread* thread);
+ ~WritableVMIsolateScope();
+};
+
} // namespace dart
#endif // VM_HEAP_H_
« no previous file with comments | « no previous file | runtime/vm/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698