mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-10 06:54:04 +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
|
var romMapping = 255
|
||||||
internal set
|
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 {
|
||||||
init()
|
init()
|
||||||
}
|
}
|
||||||
@@ -81,6 +86,10 @@ class VM(
|
|||||||
println("[VM] Creating new VM with ID of $id, memsize $memsize")
|
println("[VM] Creating new VM with ID of $id, memsize $memsize")
|
||||||
|
|
||||||
startTime = System.nanoTime()
|
startTime = System.nanoTime()
|
||||||
|
|
||||||
|
mallocMap.clear()
|
||||||
|
mallocSizes.clear()
|
||||||
|
allocatedBlockCount = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -163,10 +172,6 @@ class VM(
|
|||||||
(memspace as PeriBase).peek(offset)
|
(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? {
|
private fun findEmptySpace(blockSize: Int): Int? {
|
||||||
var cursorHead = 0
|
var cursorHead = 0
|
||||||
var cursorTail: Int
|
var cursorTail: Int
|
||||||
|
|||||||
Reference in New Issue
Block a user