Implemented length storage of allocated memory
This commit is contained in:
parent
79bb606e8d
commit
3043e4e2c4
27 changed files with 134 additions and 49 deletions
|
@ -1,5 +1,12 @@
|
|||
import sys
|
||||
|
||||
alloc(length Int) -> Pointer {
|
||||
return sys.mmap(0, length, 0x1|0x2, 0x02|0x1000)
|
||||
x := sys.mmap(0, length, 0x1|0x2, 0x02|0x1000)
|
||||
|
||||
if x <= 0 {
|
||||
return x
|
||||
}
|
||||
|
||||
store(x, 8, length)
|
||||
return x + 8
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue