System: Allocate JIT space before fastmem area

On Intel MacOS 14, the fastmem area gets allocated close to the
executable base, leaving no region free +/- 2GB for the JIT area.
This commit is contained in:
Stenzek 2024-06-26 16:41:47 +10:00
parent 8c1228a7aa
commit ebf50edb79
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -332,7 +332,7 @@ bool System::Internal::CPUThreadInitialize(Error* error)
}
#endif
if (!Bus::AllocateMemory(error) || !CPU::CodeCache::ProcessStartup(error))
if (!CPU::CodeCache::ProcessStartup(error) || !Bus::AllocateMemory(error))
{
CPUThreadShutdown();
return false;

View file

@ -60,7 +60,7 @@ bool JitCodeBuffer::Allocate(u32 size /* = 64 * 1024 * 1024 */, u32 far_code_siz
reinterpret_cast<const u8*>(std::numeric_limits<uintptr_t>::max()) :
(base + max_displacement);
const u8* min_address = ((base - max_displacement) > base) ? nullptr : (base - max_displacement);
const u32 step = 256 * 1024 * 1024;
const u32 step = 64 * 1024 * 1024;
const u32 steps = static_cast<u32>(max_address - min_address) / step;
for (u32 offset = 0; offset < steps; offset++)
{