From c0e577c4dc92402f8214383766bae8ad03d4c42a Mon Sep 17 00:00:00 2001 From: kd-11 Date: Wed, 28 Aug 2024 06:48:31 +0300 Subject: [PATCH] Allow overcommit on macos --- Utilities/JITASM.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Utilities/JITASM.cpp b/Utilities/JITASM.cpp index b1d227fc15..33751acd64 100644 --- a/Utilities/JITASM.cpp +++ b/Utilities/JITASM.cpp @@ -9,7 +9,7 @@ #include "util/v128.hpp" #include "util/simd.hpp" -#ifdef __linux__ +#if defined(__linux__) || defined(__APPLE__) #include #define CAN_OVERCOMMIT #endif @@ -185,13 +185,7 @@ static u8* add_jit_memory(usz size, usz align) if (olda != newa) [[unlikely]] { #ifndef CAN_OVERCOMMIT - // Commit more memory. - // 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); - } + utils::memory_commit(pointer + olda, newa - olda, Prot); #endif // Acknowledge committed memory Ctr.atomic_op([&](u64& ctr)