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;
+1 -1
View File
@@ -260,7 +260,7 @@ struct MemoryManager1 : llvm::RTDyldMemoryManager
// utils::memory_decommit(m_code_mems, how_much(code_ptr));
// utils::memory_decommit(m_data_ro_mems, how_much(data_ro_ptr));
// utils::memory_decommit(m_data_rw_mems, how_much(data_rw_ptr));
utils::memory_decommit(m_code_mems, c_max_size * 3);
utils::memory_decommit(m_code_mems, c_max_size * 3, true);
}
llvm::JITSymbol findSymbol(const std::string& name) override