diff --git a/lib/mem/alloc_linux.q b/lib/mem/alloc_linux.q new file mode 100644 index 0000000..70929fe --- /dev/null +++ b/lib/mem/alloc_linux.q @@ -0,0 +1,5 @@ +import sys + +alloc(length Int) -> Pointer { + return sys.mmap(0, length, 0x1|0x2, 0x02|0x20) +} \ No newline at end of file diff --git a/lib/mem/alloc_mac.q b/lib/mem/alloc_mac.q new file mode 100644 index 0000000..bdeb356 --- /dev/null +++ b/lib/mem/alloc_mac.q @@ -0,0 +1,5 @@ +import sys + +alloc(length Int) -> Pointer { + return sys.mmap(0, length, 0x1|0x2, 0x02|0x1000) +} \ No newline at end of file diff --git a/lib/mem/alloc.q b/lib/mem/free.q similarity index 51% rename from lib/mem/alloc.q rename to lib/mem/free.q index 747290a..432d65d 100644 --- a/lib/mem/alloc.q +++ b/lib/mem/free.q @@ -1,9 +1,5 @@ import sys -alloc(length Int) -> Pointer { - return sys.mmap(0, length, 0x1|0x2, 0x02|0x20|0x100) -} - free(address Pointer, length Int) -> Int { return sys.munmap(address, length) } \ No newline at end of file