mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-03-05 22:07:42 +00:00
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:
parent
8c1228a7aa
commit
ebf50edb79
src
|
@ -332,7 +332,7 @@ bool System::Internal::CPUThreadInitialize(Error* error)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!Bus::AllocateMemory(error) || !CPU::CodeCache::ProcessStartup(error))
|
if (!CPU::CodeCache::ProcessStartup(error) || !Bus::AllocateMemory(error))
|
||||||
{
|
{
|
||||||
CPUThreadShutdown();
|
CPUThreadShutdown();
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -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()) :
|
reinterpret_cast<const u8*>(std::numeric_limits<uintptr_t>::max()) :
|
||||||
(base + max_displacement);
|
(base + max_displacement);
|
||||||
const u8* min_address = ((base - max_displacement) > base) ? nullptr : (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;
|
const u32 steps = static_cast<u32>(max_address - min_address) / step;
|
||||||
for (u32 offset = 0; offset < steps; offset++)
|
for (u32 offset = 0; offset < steps; offset++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue