Added array type
This commit is contained in:
10
lib/io/io.q
10
lib/io/io.q
@ -1,21 +1,21 @@
|
||||
import sys
|
||||
|
||||
in(buffer Pointer) -> Int {
|
||||
in(buffer []Int8) -> Int {
|
||||
return sys.read(0, buffer, len(buffer))
|
||||
}
|
||||
|
||||
out(message Pointer) -> Int {
|
||||
out(message []Int8) -> Int {
|
||||
return sys.write(1, message, len(message))
|
||||
}
|
||||
|
||||
error(message Pointer) -> Int {
|
||||
error(message []Int8) -> Int {
|
||||
return sys.write(2, message, len(message))
|
||||
}
|
||||
|
||||
read(fd Int, buffer Pointer) -> Int {
|
||||
read(fd Int, buffer []Int8) -> Int {
|
||||
return sys.read(fd, buffer, len(buffer))
|
||||
}
|
||||
|
||||
write(fd Int, message Pointer) -> Int {
|
||||
write(fd Int, message []Int8) -> Int {
|
||||
return sys.write(fd, message, len(message))
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
import sys
|
||||
|
||||
alloc(length Int) -> Pointer {
|
||||
alloc(length Int) -> []Int8 {
|
||||
x := sys.mmap(0, length+8, 0x1|0x2, 0x02|0x20)
|
||||
|
||||
if x < 0x1000 {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import sys
|
||||
|
||||
alloc(length Int) -> Pointer {
|
||||
alloc(length Int) -> []Int8 {
|
||||
x := sys.mmap(0, length+8, 0x1|0x2, 0x02|0x1000)
|
||||
|
||||
if x < 0x1000 {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import sys
|
||||
|
||||
alloc(length Int) -> Pointer {
|
||||
alloc(length Int) -> []Int8 {
|
||||
x := sys.mmap(0, length+8, 0x0004, 0x3000)
|
||||
|
||||
if x < 0x1000 {
|
||||
|
Reference in New Issue
Block a user