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

Unified Diff: runtime/vm/virtual_memory_macos.cc

Issue 1710443003: Fix background compilation: allocate stubs at safepoint (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: d Created 4 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
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());

Powered by Google App Engine
This is Rietveld 408576698