]> gitweb.factorcode.org Git - factor.git/commitdiff
os-unix: Add MAP_JIT for apple arm64
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 3 Dec 2020 00:16:27 +0000 (18:16 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 3 Dec 2020 00:16:27 +0000 (18:16 -0600)
vm/os-unix.cpp

index 5d030d2c8e5c9aae60a9a4ccd891f66ae716a748..167338d5fa47403be9baf5e3008a1560b2519f73 100644 (file)
@@ -86,8 +86,13 @@ segment::segment(cell size_, bool executable_p) {
     prot = PROT_READ | PROT_WRITE;
 
   cell alloc_size = 2 * pagesize + size;
+#if defined(__APPLE__) && defined(FACTOR_ARM64)  // FIXME: could be in header file
+  char* array = (char*)mmap(NULL, alloc_size, prot,
+                            MAP_ANON | MAP_PRIVATE | MAP_JIT, -1, 0);
+#else
   char* array = (char*)mmap(NULL, alloc_size, prot,
                             MAP_ANON | MAP_PRIVATE, -1, 0);
+#endif
 
   if (array == (char*)-1)
     fatal_error("Out of memory in mmap", alloc_size);