Skip to content

Commit 72d077f

Browse files
Fix OOM with Clear NAND
1 parent ff7015e commit 72d077f

File tree

1 file changed

+6
-0
lines changed
  • src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS

1 file changed

+6
-0
lines changed

src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,12 @@ static void InitIv(Span<byte> iv, ReadOnlySpan<byte> nonce)
382382
// NAND is 240MiB, round off to 256MiBs here (extra 16MiB for other misc allocations)
383383
mmapMiBSize += 256;
384384

385+
// clear NAND code allocates quite a bit of memory (enough for another copy of NAND itself)
386+
if (_activeSyncSettings.ClearNAND || lp.DeterministicEmulationRequested)
387+
{
388+
mmapMiBSize += 256;
389+
}
390+
385391
if (_activeSyncSettings.EnableDSiSDCard)
386392
{
387393
mmapMiBSize += 256;

0 commit comments

Comments
 (0)