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

Unified Diff: runtime/vm/virtual_memory.h

Issue 106593002: Write protect executable pages in the VM. Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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/pages.cc ('k') | runtime/vm/virtual_memory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/virtual_memory.h
diff --git a/runtime/vm/virtual_memory.h b/runtime/vm/virtual_memory.h
index 2bc0f78a2673615763ec6b56bbe8c58e909da6c1..09eeb7e8a246f0518eddbe789cb875550f290f09 100644
--- a/runtime/vm/virtual_memory.h
+++ b/runtime/vm/virtual_memory.h
@@ -41,7 +41,10 @@ class VirtualMemory {
}
// Changes the protection of the virtual memory area.
- bool Protect(Protection mode);
+ static bool Protect(void* address, intptr_t size, Protection mode);
+ bool Protect(Protection mode) {
+ return Protect(address(), size(), mode);
+ }
// Reserves a virtual memory segment with size. If a segment of the requested
// size cannot be allocated NULL is returned.
@@ -57,6 +60,8 @@ class VirtualMemory {
return page_size_;
}
+ static bool InSamePage(uword address0, uword address1);
+
private:
// Truncate this virtual memory segment.
void Truncate(uword new_start, intptr_t size);
« no previous file with comments | « runtime/vm/pages.cc ('k') | runtime/vm/virtual_memory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698