Implemented length storage of allocated memory

This commit is contained in:
2025-02-09 14:14:41 +01:00
parent 1ff56e0856
commit 2b2e707520
27 changed files with 134 additions and 49 deletions

View File

@ -1,5 +1,12 @@
import sys
alloc(length Int) -> Pointer {
return sys.mmap(0, length, 0x0004, 0x3000)
x := sys.mmap(0, length, 0x0004, 0x3000)
if x <= 0 {
return x
}
store(x, 8, length)
return x + 8
}