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

Unified Diff: runtime/vm/virtual_memory.h

Issue 136563002: Landing: Write protect executable pages in the VM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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/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
===================================================================
--- runtime/vm/virtual_memory.h (revision 32487)
+++ runtime/vm/virtual_memory.h (working copy)
@@ -13,12 +13,12 @@
class VirtualMemory {
public:
+ // Read-write-execute is not available because it is never used.
enum Protection {
kNoAccess,
kReadOnly,
kReadWrite,
kReadExecute,
- kReadWriteExecute
};
// The reserved memory is unmapped on destruction.
@@ -41,7 +41,10 @@
}
// 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 @@
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