mirror of
https://git.wownero.com/wownero/RandomWOW.git
synced 2025-01-03 05:38:54 +00:00
Merge pull request #217 from hyc/issue216
Fix #216 - MacOS JIT privs are not ARM-specific
This commit is contained in:
commit
b27283a708
@ -36,7 +36,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifdef __APPLE__
|
||||
#include <mach/vm_statistics.h>
|
||||
#include <TargetConditionals.h>
|
||||
# if defined(__aarch64__) && TARGET_OS_OSX
|
||||
# ifdef TARGET_OS_OSX
|
||||
# define USE_PTHREAD_JIT_WP 1
|
||||
# include <pthread.h>
|
||||
# endif
|
||||
@ -104,19 +104,11 @@ void* allocMemoryPages(std::size_t bytes) {
|
||||
#else
|
||||
#define RESERVED_FLAGS 0
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
#include <TargetConditionals.h>
|
||||
#ifdef TARGET_OS_OSX
|
||||
#define MEXTRA MAP_JIT
|
||||
#else
|
||||
#define MEXTRA 0
|
||||
#endif
|
||||
#else
|
||||
#define MEXTRA 0
|
||||
#endif
|
||||
#ifdef USE_PTHREAD_JIT_WP
|
||||
#define MEXTRA MAP_JIT
|
||||
#define PEXTRA PROT_EXEC
|
||||
#else
|
||||
#define MEXTRA 0
|
||||
#define PEXTRA 0
|
||||
#endif
|
||||
mem = mmap(nullptr, bytes, PAGE_READWRITE | RESERVED_FLAGS | PEXTRA, MAP_ANONYMOUS | MAP_PRIVATE | MEXTRA, -1, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user