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

Unified Diff: runtime/vm/heap.cc

Issue 10830045: - Add the ability to protect VirtualMemory. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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
===================================================================
--- runtime/vm/heap.cc (revision 9969)
+++ runtime/vm/heap.cc (working copy)
@@ -36,7 +36,7 @@
"code heap size in MB,"
"e.g: --code_heap_size=8 allocates a 8MB code heap");
-Heap::Heap() {
+ Heap::Heap() : read_only_(false) {
new_space_ = new Scavenger(this,
(FLAG_new_gen_heap_size * MB),
kNewObjectAlignmentOffset);
@@ -226,6 +226,15 @@
}
+void Heap::WriteProtect(bool read_only) {
+ read_only_ = read_only;
+ new_space_->WriteProtect(read_only);
+ old_space_->WriteProtect(read_only);
+ // TODO(iposva): Merge old and code space.
+ // code_space_->WriteProtect(read_only);
+}
+
+
uword Heap::TopAddress() {
return reinterpret_cast<uword>(new_space_->TopAddress());
}
« 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