| Index: runtime/vm/virtual_memory_macos.cc
|
| diff --git a/runtime/vm/virtual_memory_macos.cc b/runtime/vm/virtual_memory_macos.cc
|
| index f28da352ef30940154baf3b98c23931e187c36ad..484ad7876616fda5d25850acc08d68711fe162d0 100644
|
| --- a/runtime/vm/virtual_memory_macos.cc
|
| +++ b/runtime/vm/virtual_memory_macos.cc
|
| @@ -13,6 +13,8 @@
|
| #include "platform/assert.h"
|
| #include "platform/utils.h"
|
|
|
| +#include "vm/isolate.h"
|
| +
|
| namespace dart {
|
|
|
| // standard MAP_FAILED causes "error: use of old-style cast" as it
|
| @@ -80,6 +82,8 @@ bool VirtualMemory::Commit(uword addr, intptr_t size, bool executable) {
|
|
|
|
|
| bool VirtualMemory::Protect(void* address, intptr_t size, Protection mode) {
|
| + ASSERT(Thread::Current()->IsMutatorThread() ||
|
| + Isolate::Current()->mutator_thread()->IsAtSafepoint());
|
| uword start_address = reinterpret_cast<uword>(address);
|
| uword end_address = start_address + size;
|
| uword page_address = Utils::RoundDown(start_address, PageSize());
|
|
|