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

Unified Diff: runtime/vm/pages.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
Index: runtime/vm/pages.cc
===================================================================
--- runtime/vm/pages.cc (revision 9969)
+++ runtime/vm/pages.cc (working copy)
@@ -87,6 +87,11 @@
}
+void HeapPage::Protect(VirtualMemory::Protection mode) {
+ memory_->Protect(mode);
+}
+
+
PageSpace::PageSpace(Heap* heap, intptr_t max_capacity, bool is_executable)
: freelist_(),
heap_(heap),
@@ -340,6 +345,20 @@
}
+void PageSpace::Protect(VirtualMemory::Protection mode) {
+ HeapPage* page = pages_;
+ while (page != NULL) {
+ page->Protect(mode);
+ page = page->next();
+ }
+ page = large_pages_;
+ while (page != NULL) {
+ page->Protect(mode);
+ page = page->next();
+ }
siva 2012/07/27 01:55:00 How does this work in the face of heap growth? i.
Ivan Posva 2012/07/27 18:02:56 A read-write heap should be able to grow a read-on
+}
+
+
void PageSpace::MarkSweep(bool invoke_api_callbacks) {
// MarkSweep is not reentrant. Make sure that is the case.
ASSERT(!sweeping_);
« runtime/vm/object.cc ('K') | « runtime/vm/pages.h ('k') | runtime/vm/scavenger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698