message: Cherry picked commit 'virtual_memory: add MAP_JIT on macOS' from
diff: @@ -99,7 +99,17 @@ void* allocMemoryPages(std::size_t bytes) {
  #else
  #define RESERVED_FLAGS 0
  #endif
  - mem = mmap(nullptr, bytes, PAGE_READWRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
  + #ifdef __APPLE__
  + #include <TargetConditionals.h>
  + #ifdef TARGET_OS_OSX
  + #define MEXTRA MAP_JIT
  + #else
  + #define MEXTRA 0
  + #endif
  + #else
  + #define MEXTRA 0
  + #endif
  + mem = mmap(nullptr, bytes, PAGE_READWRITE | RESERVED_FLAGS, MAP_ANONYMOUS | MAP_PRIVATE | MEXTRA, -1, 0);
  if (mem == MAP_FAILED)
  throw std::runtime_error("allocMemoryPages - mmap failed");
  #endif
  