35#include <TargetConditionals.h>
37#if (defined(TARGET_OS_OSX) && TARGET_OS_OSX) || (TARGET_OS_MAC && !TARGET_OS_IPHONE)
39#if defined(SLJIT_CONFIG_X86) && SLJIT_CONFIG_X86
41#include <sys/utsname.h>
44#define SLJIT_UPDATE_WX_FLAGS(from, to, enable_exec)
47#define SLJIT_MAP_JIT (get_map_jit_flag())
53 static int map_jit_flag = -1;
55 if (map_jit_flag < 0) {
60 if (atoi(
name.release) >= 18) {
61 page_size = get_page_alignment() + 1;
64 MAP_PRIVATE | MAP_ANON, -1, 0);
67 munmap(
ptr, page_size);
69 map_jit_flag = MAP_JIT;
75#define SLJIT_MAP_JIT (0)
78#elif defined(SLJIT_CONFIG_ARM) && SLJIT_CONFIG_ARM
80#include <AvailabilityMacros.h>
83#define SLJIT_MAP_JIT (MAP_JIT)
84#define SLJIT_UPDATE_WX_FLAGS(from, to, enable_exec) \
85 apple_update_wx_flags(enable_exec)
89#if MAC_OS_X_VERSION_MIN_REQUIRED < 110000
90 if (__builtin_available(macos 11, *))
92 pthread_jit_write_protect_np(enable_exec);
95#elif defined(SLJIT_CONFIG_PPC) && SLJIT_CONFIG_PPC
97#define SLJIT_MAP_JIT (0)
98#define SLJIT_UPDATE_WX_FLAGS(from, to, enable_exec)
101#error "Unsupported architecture"
107#define SLJIT_MAP_JIT (MAP_JIT)
109#define SLJIT_MAP_JIT (0)
118 int flags = MAP_PRIVATE;
#define SLJIT_UPDATE_WX_FLAGS(from, to, enable_exec)