Some fixes and added in globals

This commit is contained in:
Nathan Braswell
2016-05-31 21:29:05 -07:00
parent 593877eb84
commit cf8656a538
8 changed files with 71 additions and 102 deletions

View File

@@ -3,6 +3,13 @@ ext fun malloc(size: ulong): *void
ext fun free(size: *void)
ext fun memmove(dest: *void, src: *void, size: ulong): *void
fun calloc(size: ulong): *void {
var to_ret = malloc(size)
for (var i = 0; i < size; i++;)
*((to_ret) cast *char + i) = 0
return to_ret
}
fun null<T>(): *T
return (0) cast *T