Skip to content

Commit

Permalink
Properly reset memory arena on reset
Browse files Browse the repository at this point in the history
  • Loading branch information
wheremyfoodat committed Nov 30, 2024
1 parent 4ec776f commit 19769e8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 19769e8

Please sign in to comment.