mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-11 05:31:51 +09:00
mp2 test
This commit is contained in:
@@ -230,6 +230,8 @@ class VM(
|
||||
}
|
||||
|
||||
internal fun malloc(size: Int): Int {
|
||||
if (size <= 0) throw IllegalArgumentException("Invalid malloc size: $size")
|
||||
|
||||
val allocBlocks = ceil(size.toDouble() / MALLOC_UNIT).toInt()
|
||||
val blockStart = findEmptySpace(allocBlocks) ?: throw OutOfMemoryError()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user