Enable ASLR

This commit is contained in:
Vestral 2025-03-15 10:02:46 +09:00 committed by Megamouse
parent 68e7f4e820
commit e2df71d87c
8 changed files with 84 additions and 69 deletions

View file

@ -344,15 +344,7 @@ jit_runtime_base& asmjit::get_global_runtime()
{
custom_runtime() noexcept
{
// Search starting in first 2 GiB of memory
for (u64 addr = size;; addr += size)
{
if (auto ptr = utils::memory_reserve(size, reinterpret_cast<void*>(addr)))
{
m_pos.raw() = static_cast<uchar*>(ptr);
break;
}
}
ensure(m_pos.raw() = static_cast<uchar*>(utils::memory_reserve(size)));
// Initialize "end" pointer
m_max = m_pos + size;