mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-16 23:17:29 +00:00
Allow overcommit on macos
This commit is contained in:
parent
00a0c4e69d
commit
c0e577c4dc
@ -9,7 +9,7 @@
|
|||||||
#include "util/v128.hpp"
|
#include "util/v128.hpp"
|
||||||
#include "util/simd.hpp"
|
#include "util/simd.hpp"
|
||||||
|
|
||||||
#ifdef __linux__
|
#if defined(__linux__) || defined(__APPLE__)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#define CAN_OVERCOMMIT
|
#define CAN_OVERCOMMIT
|
||||||
#endif
|
#endif
|
||||||
@ -185,13 +185,7 @@ static u8* add_jit_memory(usz size, usz align)
|
|||||||
if (olda != newa) [[unlikely]]
|
if (olda != newa) [[unlikely]]
|
||||||
{
|
{
|
||||||
#ifndef CAN_OVERCOMMIT
|
#ifndef CAN_OVERCOMMIT
|
||||||
// Commit more memory.
|
utils::memory_commit(pointer + olda, newa - olda, Prot);
|
||||||
// NOTE: Calling memory commit in parallel on the same addresses can throw a permission error.
|
|
||||||
{
|
|
||||||
static std::mutex mcommit_lock;
|
|
||||||
std::lock_guard lock(mcommit_lock);
|
|
||||||
utils::memory_commit(pointer + olda, newa - olda, Prot);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
// Acknowledge committed memory
|
// Acknowledge committed memory
|
||||||
Ctr.atomic_op([&](u64& ctr)
|
Ctr.atomic_op([&](u64& ctr)
|
||||||
|
Loading…
Reference in New Issue
Block a user