mirror of
https://git.wownero.com/wownero/RandomWOW.git
synced 2024-12-22 07:48:54 +00:00
Merge pull request #183 from selsta/map_jit
virtual_memory: add MAP_JIT on macOS
This commit is contained in:
commit
5bfd021e8f
@ -99,7 +99,17 @@ void* allocMemoryPages(std::size_t bytes) {
|
||||
#else
|
||||
#define RESERVED_FLAGS 0
|
||||
#endif
|
||||
mem = mmap(nullptr, bytes, PAGE_READWRITE | RESERVED_FLAGS, 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
|
||||
|
Loading…
Reference in New Issue
Block a user