mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 19:51:51 +09:00
fixed a bug where softresetting would not clear the malloc map
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user