Apple M1: OS version checking for MAP_JIT
- Added MacOS version checking around MAP_JIT to prepare code for x86 MAP_JIT
This commit is contained in:
parent
948764d37b
commit
4542038cd0
|
@ -41,6 +41,8 @@ void* AllocateExecutableMemory(size_t size)
|
|||
#else
|
||||
int map_flags = MAP_ANON | MAP_PRIVATE;
|
||||
#if defined(_M_ARM_64) && defined(__APPLE__)
|
||||
// This check is in place to prepare for x86_64 MAP_JIT support.
|
||||
if (__builtin_available(macOS 10.14, *))
|
||||
map_flags |= MAP_JIT;
|
||||
#endif
|
||||
void* ptr = mmap(nullptr, size, PROT_READ | PROT_WRITE | PROT_EXEC, map_flags, -1, 0);
|
||||
|
|
Loading…
Reference in New Issue