mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-12 22:16:05 +09:00
stopping and restarting the vm
This commit is contained in:
@@ -79,14 +79,22 @@ class VM(
|
||||
contexts.clear()
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes the VM stop suddenly without disposing of.
|
||||
*/
|
||||
fun park() {
|
||||
killAllContexts()
|
||||
startTime = -1
|
||||
}
|
||||
|
||||
fun init() {
|
||||
killAllContexts()
|
||||
|
||||
startTime = System.currentTimeMillis()
|
||||
|
||||
usermem.fillWith(0)
|
||||
mallocMap.clear()
|
||||
mallocSizes.clear()
|
||||
allocatedBlockCount = 0
|
||||
|
||||
startTime = System.currentTimeMillis()
|
||||
}
|
||||
|
||||
|
||||
@@ -115,6 +123,7 @@ class VM(
|
||||
disposed = true
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* To check if the VM has started, check if startTime >= 0
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user