diff options
| author | Skyler Saleh <skylersaleh@gmail.com> | 2021-04-17 16:18:18 -0700 |
|---|---|---|
| committer | Skyler Saleh <skylersaleh@gmail.com> | 2021-05-22 15:25:17 -0700 |
| commit | 4542038cd0ec8359d9faa21699c85d025c5ec8ca (patch) | |
| tree | 6a81cd6ef613f882c3610968c3fe626b228c13c7 /Source/Core/Common/MemoryUtil.cpp | |
| parent | 948764d37bdbb89e84886e233dea47fba0cb1017 (diff) | |
Apple M1: OS version checking for MAP_JIT
- Added MacOS version checking around MAP_JIT to prepare code for x86 MAP_JIT
Diffstat (limited to 'Source/Core/Common/MemoryUtil.cpp')
| -rw-r--r-- | Source/Core/Common/MemoryUtil.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/Core/Common/MemoryUtil.cpp b/Source/Core/Common/MemoryUtil.cpp index d1e9d25785..e81637912e 100644 --- a/Source/Core/Common/MemoryUtil.cpp +++ b/Source/Core/Common/MemoryUtil.cpp @@ -41,7 +41,9 @@ void* AllocateExecutableMemory(size_t size) #else int map_flags = MAP_ANON | MAP_PRIVATE; #if defined(_M_ARM_64) && defined(__APPLE__) - map_flags |= MAP_JIT; + // 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); if (ptr == MAP_FAILED) |
