Simplified standard library
This commit is contained in:
@ -1,15 +1,5 @@
|
||||
import sys
|
||||
|
||||
const prot {
|
||||
read 0x1
|
||||
write 0x2
|
||||
}
|
||||
|
||||
const map {
|
||||
private 0x02
|
||||
anonymous 0x20
|
||||
}
|
||||
|
||||
alloc(length int) -> []int8 {
|
||||
x := sys.mmap(0, length+8, prot.read|prot.write, map.private|map.anonymous)
|
||||
|
||||
@ -19,4 +9,14 @@ alloc(length int) -> []int8 {
|
||||
|
||||
store(x, 8, length)
|
||||
return x + 8
|
||||
}
|
||||
|
||||
const prot {
|
||||
read 0x1
|
||||
write 0x2
|
||||
}
|
||||
|
||||
const map {
|
||||
private 0x02
|
||||
anonymous 0x20
|
||||
}
|
@ -1,15 +1,5 @@
|
||||
import sys
|
||||
|
||||
const prot {
|
||||
read 0x1
|
||||
write 0x2
|
||||
}
|
||||
|
||||
const map {
|
||||
private 0x02
|
||||
anonymous 0x1000
|
||||
}
|
||||
|
||||
alloc(length int) -> []int8 {
|
||||
x := sys.mmap(0, length+8, prot.read|prot.write, map.private|map.anonymous)
|
||||
|
||||
@ -19,4 +9,14 @@ alloc(length int) -> []int8 {
|
||||
|
||||
store(x, 8, length)
|
||||
return x + 8
|
||||
}
|
||||
|
||||
const prot {
|
||||
read 0x1
|
||||
write 0x2
|
||||
}
|
||||
|
||||
const map {
|
||||
private 0x02
|
||||
anonymous 0x1000
|
||||
}
|
@ -1,14 +1,5 @@
|
||||
import sys
|
||||
|
||||
const page {
|
||||
readwrite 0x0004
|
||||
}
|
||||
|
||||
const mem {
|
||||
commit 0x1000
|
||||
reserve 0x2000
|
||||
}
|
||||
|
||||
alloc(length int) -> []int8 {
|
||||
x := sys.mmap(0, length+8, page.readwrite, mem.commit|mem.reserve)
|
||||
|
||||
@ -18,4 +9,13 @@ alloc(length int) -> []int8 {
|
||||
|
||||
store(x, 8, length)
|
||||
return x + 8
|
||||
}
|
||||
|
||||
const page {
|
||||
readwrite 0x0004
|
||||
}
|
||||
|
||||
const mem {
|
||||
commit 0x1000
|
||||
reserve 0x2000
|
||||
}
|
Reference in New Issue
Block a user