mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-07 15:36:26 +00:00
Block parallel JIT allocation on macos
This commit is contained in:
parent
ce9024efc5
commit
4d193ecb6a
2 changed files with 6 additions and 7 deletions
|
|
@ -260,13 +260,7 @@ namespace utils
|
|||
|
||||
#ifdef __APPLE__
|
||||
#ifdef ARCH_ARM64
|
||||
// NOTE: On MacOS, parallel calls to mmap can return the same address more than once. Trying to madvise the same address twice throws EPERM.
|
||||
static std::mutex mmap_lock;
|
||||
void* ptr;
|
||||
{
|
||||
std::lock_guard lock(mmap_lock);
|
||||
ptr = ::mmap(use_addr, size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE | MAP_JIT | c_map_noreserve, -1, 0);
|
||||
}
|
||||
auto ptr = ::mmap(use_addr, size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE | MAP_JIT | c_map_noreserve, -1, 0);
|
||||
#else
|
||||
auto ptr = ::mmap(use_addr, size, PROT_NONE, MAP_ANON | MAP_PRIVATE | MAP_JIT | c_map_noreserve, -1, 0);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue