diff --git a/lib/mem/alloc_linux.q b/lib/mem/alloc_linux.q index df8fe5b..2389b04 100644 --- a/lib/mem/alloc_linux.q +++ b/lib/mem/alloc_linux.q @@ -3,7 +3,7 @@ import sys alloc(length Int) -> Pointer { x := sys.mmap(0, length+8, 0x1|0x2, 0x02|0x20) - if x <= 0 { + if x < 0x1000 { return x } diff --git a/lib/mem/alloc_mac.q b/lib/mem/alloc_mac.q index 42da24b..6ffda84 100644 --- a/lib/mem/alloc_mac.q +++ b/lib/mem/alloc_mac.q @@ -1,9 +1,9 @@ import sys alloc(length Int) -> Pointer { - x := sys.mmap(0, length, 0x1|0x2, 0x02|0x1000) + x := sys.mmap(0, length+8, 0x1|0x2, 0x02|0x1000) - if x <= 0 { + if x < 0x1000 { return x } diff --git a/lib/mem/alloc_windows.q b/lib/mem/alloc_windows.q index 616fb84..d448dd0 100644 --- a/lib/mem/alloc_windows.q +++ b/lib/mem/alloc_windows.q @@ -1,9 +1,9 @@ import sys alloc(length Int) -> Pointer { - x := sys.mmap(0, length, 0x0004, 0x3000) + x := sys.mmap(0, length+8, 0x0004, 0x3000) - if x <= 0 { + if x < 0x1000 { return x }