Chromium Code Reviews| 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..2bda0fb6eb128e5e3333e0e57aacacc2e71c0285 100644 |
| --- a/runtime/vm/virtual_memory_macos.cc |
| +++ b/runtime/vm/virtual_memory_macos.cc |
| @@ -13,6 +13,9 @@ |
| #include "platform/assert.h" |
| #include "platform/utils.h" |
| +#include "vm/isolate.h" |
| +#include "vm/thread.h" |
|
siva
2016/02/17 21:07:49
These header files are not included in the other O
srdjan
2016/02/17 21:15:15
Removed thread.h; added it to other OS-s as well.
|
| + |
| namespace dart { |
| // standard MAP_FAILED causes "error: use of old-style cast" as it |
| @@ -80,6 +83,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()); |