ref: 6047575d5d08efd7d0f1cd3b837b90d0d1150c30
parent: a55b663c54d5c3115879b6ee88fecf375049d6c2
parent: f12188aeeb9d6cef0ce0c2a611b85e18a76eb672
author: Ori Bernstein <[email protected]>
date: Mon Jul 23 13:07:16 EDT 2012
Merge branch 'master' of git+ssh://mimir.eigenstate.org/git/ori/libmyr
--- a/bld.sh
+++ b/bld.sh
@@ -17,6 +17,7 @@
function use {
for i in $@; do
N=`basename $i .myr`
+ N=${N%%-$SYS}
echo $MU -o $N.use $i && \
$MU -o $N.use $i
@@ -40,10 +41,11 @@
ASM=syscall-$SYS.s
# Myrddin source must be specified in dependency order
-MYR="sys-$SYS.myr \
+MYR="\
types.myr \
- alloc.myr \
+ sys-$SYS.myr \
die.myr \
+ alloc.myr \
hello.myr"
OBJ="$(echo $ASM | sed 's/\.s/.o /g') $(echo $MYR | sed 's/\.myr/.o /g')"
assem $ASM
--- a/hello.myr
+++ b/hello.myr
@@ -2,7 +2,7 @@
use "alloc.use"
const main = {
- var x : int*
- x = std.alloc()
+ var x
+ x = std.bytealloc(32)
std.write(1, "Hello world\n")
}
--- a/sys-linux.myr
+++ b/sys-linux.myr
@@ -82,7 +82,7 @@
const write : (fd:int, buf:byte[,] -> int)
const lseek : (fd:int, off:uint, whence:int -> int)
const fstat : (fd:int, sb:statbuf* -> int)
- const munmap : (addr:byte*, len:uint -> int)
+ const munmap : (addr:byte*, len:size -> int)
const mmap : (addr:byte*, len:size, prot:mprot, flags:mopt, fd:int, off:off -> byte*)
;;
--- a/sys-osx.myr
+++ b/sys-osx.myr
@@ -92,7 +92,7 @@
const write : (fd:int, buf:byte[,] -> int)
const lseek : (fd:int, off:uint, whence:int -> int)
const fstat : (fd:int, sb:statbuf* -> int)
- const munmap : (addr:byte*, len:uint -> int)
+ const munmap : (addr:byte*, len:size -> int)
const mmap : (addr:byte*, len:size, prot:mprot, flags:mopt, fd:int, off:off -> byte*)
;;