mirror of
https://github.com/xmrig/xmrig.git
synced 2024-11-16 15:57:38 +00:00
Merge remote-tracking branch 'remotes/origin/dev' into evo
This commit is contained in:
commit
5e13d78315
1 changed files with 9 additions and 3 deletions
|
@ -112,13 +112,19 @@ bool xmrig::VirtualMemory::protectRWX(void *p, size_t size)
|
||||||
|
|
||||||
bool xmrig::VirtualMemory::protectRX(void *p, size_t size)
|
bool xmrig::VirtualMemory::protectRX(void *p, size_t size)
|
||||||
{
|
{
|
||||||
|
bool result = true;
|
||||||
|
|
||||||
# if defined(XMRIG_OS_APPLE) && defined(XMRIG_ARM)
|
# if defined(XMRIG_OS_APPLE) && defined(XMRIG_ARM)
|
||||||
pthread_jit_write_protect_np(true);
|
pthread_jit_write_protect_np(true);
|
||||||
flushInstructionCache(p, size);
|
|
||||||
return true;
|
|
||||||
# else
|
# else
|
||||||
return mprotect(p, size, PROT_READ | PROT_EXEC) == 0;
|
result = (mprotect(p, size, PROT_READ | PROT_EXEC) == 0);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# if defined(XMRIG_ARM)
|
||||||
|
flushInstructionCache(p, size);
|
||||||
|
# endif
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue