mirror of
https://github.com/par274/sharpemu.git
synced 2026-08-01 07:29:43 +08:00
6aa78bb55b
When TryAllocateAtExact fails for the main image base (0x800000000 for PS5, 0x400000 for PS4), the loader previously threw a fatal InvalidOperationException with no recovery path. This happens when the host OS has already claimed part of that address range — common under Rosetta 2, with aggressive ASLR, or when another process maps into the guest address space. Instead of failing immediately, attempt TryBackFixedRange which backs the range page by page, claiming any free gaps. If the backfill also fails, Clear() rolls back partial allocations and the exception now includes platform-specific recovery advice. This prevents the most common emulator startup crash on affected hosts. Co-authored-by: tru3 <tru3@tru3.com>