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()); |
} |