From 19769e891f1552f84e0e61aa55c64c8ab6b51586 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Sat, 30 Nov 2024 19:54:28 +0200 Subject: [PATCH] Properly reset memory arena on reset --- src/core/memory.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/memory.cpp b/src/core/memory.cpp index b4a8ea675..5675196ad 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -53,6 +53,11 @@ void Memory::reset() { usedUserMemory = u32(0_MB); usedSystemMemory = u32(0_MB); + if (useFastmem) { + // Unmap any mappings when resetting + arena->Unmap(0, 4_GB, false); + } + for (u32 i = 0; i < totalPageCount; i++) { readTable[i] = 0; writeTable[i] = 0;