mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 11:51:49 +09:00
command to see memory allocation status
This commit is contained in:
2
assets/disk0/malloc.js
Normal file
2
assets/disk0/malloc.js
Normal file
@@ -0,0 +1,2 @@
|
||||
let [blockSize, blockCount] = sys.getMallocStatus()
|
||||
println(`${blockSize * blockCount} bytes allocated (${blockCount} blocks with ${blockSize} bytes per block)`)
|
||||
@@ -169,6 +169,10 @@ class VMJSR223Delegate(val vm: VM) {
|
||||
fun unsetSysrq() {
|
||||
vm.sysrqDown = false
|
||||
}
|
||||
|
||||
fun getMallocStatus(): IntArray {
|
||||
return intArrayOf(vm.MALLOC_UNIT, vm.allocatedBlockCount)
|
||||
}
|
||||
}
|
||||
|
||||
class VMSerialDebugger(val vm: VM) {
|
||||
|
||||
Reference in New Issue
Block a user