MacOS: Do not leak MAP_JIT on utils::memory_decommit

This commit is contained in:
Elad
2026-05-09 22:02:21 +03:00
parent 9dc9730898
commit 5bbce42adc
4 changed files with 14 additions and 9 deletions
+2 -2
View File
@@ -316,10 +316,10 @@ void jit_runtime::finalize() noexcept
#endif
// Reset JIT memory
#ifdef CAN_OVERCOMMIT
utils::memory_reset(get_jit_memory(), 0x80000000);
utils::memory_reset(get_jit_memory(), 0x80000000, true);
utils::memory_protect(get_jit_memory(), 0x40000000, utils::protection::wx);
#else
utils::memory_decommit(get_jit_memory(), 0x80000000);
utils::memory_decommit(get_jit_memory(), 0x80000000, true);
#endif
s_code_pos = 0;