mirror of
https://git.ryujinx.app/kenji-nx/ryujinx.git
synced 2025-12-13 13:37:08 +00:00
12 GiB heap crash workaround
Using resolution mods, heaps past 8 GiB work in some games (like LoZ: TotK) and not in others (like SMP Jamboree). Setting the heap to a hard limit of 8 GiB on the 10 & 12 GiB DRAM options seems to be the safe bet right now until a better solution is found.
This commit is contained in:
parent
ea89fc28da
commit
6d9e7fea75
2 changed files with 16 additions and 10 deletions
|
|
@ -201,9 +201,11 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
|
||||||
case ProcessCreationFlags.AddressSpace64BitDeprecated:
|
case ProcessCreationFlags.AddressSpace64BitDeprecated:
|
||||||
aliasRegion.Size = 0x180000000;
|
aliasRegion.Size = 0x180000000;
|
||||||
heapRegion.Size = memConfig switch {
|
heapRegion.Size = memConfig switch {
|
||||||
MemoryConfiguration.MemoryConfiguration10GiB
|
MemoryConfiguration.MemoryConfiguration6GiB => 0x180000000u,
|
||||||
or MemoryConfiguration.MemoryConfiguration12GiB => 0x300000000u,
|
MemoryConfiguration.MemoryConfiguration8GiB
|
||||||
_ => 0x180000000u
|
or MemoryConfiguration.MemoryConfiguration10GiB
|
||||||
|
or MemoryConfiguration.MemoryConfiguration12GiB => 0x200000000u,
|
||||||
|
_ => 0x100000000u
|
||||||
};
|
};
|
||||||
stackRegion.Size = 0;
|
stackRegion.Size = 0;
|
||||||
tlsIoRegion.Size = 0;
|
tlsIoRegion.Size = 0;
|
||||||
|
|
@ -236,9 +238,11 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
|
||||||
|
|
||||||
aliasRegion.Size = reservedAddressSpaceSize >= 0x1800000000 ? 0x1000000000 : 1UL << (addressSpaceWidth - 3);
|
aliasRegion.Size = reservedAddressSpaceSize >= 0x1800000000 ? 0x1000000000 : 1UL << (addressSpaceWidth - 3);
|
||||||
heapRegion.Size = memConfig switch {
|
heapRegion.Size = memConfig switch {
|
||||||
MemoryConfiguration.MemoryConfiguration10GiB
|
MemoryConfiguration.MemoryConfiguration6GiB => 0x180000000u,
|
||||||
or MemoryConfiguration.MemoryConfiguration12GiB => 0x300000000u,
|
MemoryConfiguration.MemoryConfiguration8GiB
|
||||||
_ => 0x180000000u
|
or MemoryConfiguration.MemoryConfiguration10GiB
|
||||||
|
or MemoryConfiguration.MemoryConfiguration12GiB => 0x200000000u,
|
||||||
|
_ => 0x100000000u
|
||||||
};
|
};
|
||||||
stackRegion.Size = 1UL << (addressSpaceWidth - 8);
|
stackRegion.Size = 1UL << (addressSpaceWidth - 8);
|
||||||
tlsIoRegion.Size = 1UL << (addressSpaceWidth - 3);
|
tlsIoRegion.Size = 1UL << (addressSpaceWidth - 3);
|
||||||
|
|
@ -254,9 +258,11 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
|
||||||
{
|
{
|
||||||
aliasRegion.Size = 0x1000000000;
|
aliasRegion.Size = 0x1000000000;
|
||||||
heapRegion.Size = memConfig switch {
|
heapRegion.Size = memConfig switch {
|
||||||
MemoryConfiguration.MemoryConfiguration10GiB
|
MemoryConfiguration.MemoryConfiguration6GiB => 0x180000000u,
|
||||||
or MemoryConfiguration.MemoryConfiguration12GiB => 0x300000000u,
|
MemoryConfiguration.MemoryConfiguration8GiB
|
||||||
_ => 0x180000000u
|
or MemoryConfiguration.MemoryConfiguration10GiB
|
||||||
|
or MemoryConfiguration.MemoryConfiguration12GiB => 0x200000000u,
|
||||||
|
_ => 0x100000000u
|
||||||
};
|
};
|
||||||
stackRegion.Size = 0x80000000;
|
stackRegion.Size = 0x80000000;
|
||||||
tlsIoRegion.Size = 0x1000000000;
|
tlsIoRegion.Size = 0x1000000000;
|
||||||
|
|
|
||||||
|
|
@ -881,7 +881,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
|
||||||
[Svc(1)]
|
[Svc(1)]
|
||||||
public Result SetHeapSize([PointerSized] out ulong address, [PointerSized] ulong size)
|
public Result SetHeapSize([PointerSized] out ulong address, [PointerSized] ulong size)
|
||||||
{
|
{
|
||||||
if ((size & 0xfffffffd001fffff) != 0)
|
if ((size & 0xfffffffe001fffff) != 0)
|
||||||
{
|
{
|
||||||
address = 0;
|
address = 0;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue