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__
|
#ifdef __APPLE__
|
||||||
#include <mach/vm_statistics.h>
|
#include <mach/vm_statistics.h>
|
||||||
#include <TargetConditionals.h>
|
#include <TargetConditionals.h>
|
||||||
# if defined(__aarch64__) && TARGET_OS_OSX
|
# ifdef TARGET_OS_OSX
|
||||||
# define USE_PTHREAD_JIT_WP 1
|
# define USE_PTHREAD_JIT_WP 1
|
||||||
# include <pthread.h>
|
# include <pthread.h>
|
||||||
# endif
|
# endif
|
||||||
@ -104,19 +104,11 @@ void* allocMemoryPages(std::size_t bytes) {
|
|||||||
#else
|
#else
|
||||||
#define RESERVED_FLAGS 0
|
#define RESERVED_FLAGS 0
|
||||||
#endif
|
#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
|
#ifdef USE_PTHREAD_JIT_WP
|
||||||
|
#define MEXTRA MAP_JIT
|
||||||
#define PEXTRA PROT_EXEC
|
#define PEXTRA PROT_EXEC
|
||||||
#else
|
#else
|
||||||
|
#define MEXTRA 0
|
||||||
#define PEXTRA 0
|
#define PEXTRA 0
|
||||||
#endif
|
#endif
|
||||||
mem = mmap(nullptr, bytes, PAGE_READWRITE | RESERVED_FLAGS | PEXTRA, MAP_ANONYMOUS | MAP_PRIVATE | MEXTRA, -1, 0);
|
mem = mmap(nullptr, bytes, PAGE_READWRITE | RESERVED_FLAGS | PEXTRA, MAP_ANONYMOUS | MAP_PRIVATE | MEXTRA, -1, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user