mirror of
https://git.wownero.com/wownero/RandomWOW.git
synced 2024-12-22 15:58:53 +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
|
#else
|
||||||
#define RESERVED_FLAGS 0
|
#define RESERVED_FLAGS 0
|
||||||
#endif
|
#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)
|
if (mem == MAP_FAILED)
|
||||||
throw std::runtime_error("allocMemoryPages - mmap failed");
|
throw std::runtime_error("allocMemoryPages - mmap failed");
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user