fixed a bug where softresetting would not clear the malloc map

This commit is contained in:
minjaesong
2022-05-03 22:23:54 +09:00
parent d3058d515d
commit 7cffff1d71

View File

@@ -58,6 +58,11 @@ class VM(
var romMapping = 255
internal set
private val mallocMap = BitSet(mallocBlockSize)
private val mallocSizes = HashMap<Int, Int>() // HashMap<Block Index, Block Count>
var allocatedBlockCount = 0; private set
init {
init()
}
@@ -81,6 +86,10 @@ class VM(
println("[VM] Creating new VM with ID of $id, memsize $memsize")
startTime = System.nanoTime()
mallocMap.clear()
mallocSizes.clear()
allocatedBlockCount = 0
}
@@ -163,10 +172,6 @@ class VM(
(memspace as PeriBase).peek(offset)
}
private val mallocMap = BitSet(mallocBlockSize)
private val mallocSizes = HashMap<Int, Int>() // HashMap<Block Index, Block Count>
var allocatedBlockCount = 0; private set
private fun findEmptySpace(blockSize: Int): Int? {
var cursorHead = 0
var cursorTail: Int