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