time is now a parameter to the tic function instead of a mutable import

This commit is contained in:
2021-11-02 23:27:15 +01:00
parent 2d901e4c61
commit 75531bbc2f
4 changed files with 8 additions and 11 deletions

View File

@@ -4,7 +4,7 @@ export fn load_uw8(module_start: i32, module_end: i32, base_start: i32, base_end
if ?module_start == 0 {
let defer length = module_end - module_start;
copy(base_end, module_start, length);
return length;
return base_end + length;
}
copy(base_end, base_start, 8);
@@ -14,7 +14,7 @@ export fn load_uw8(module_start: i32, module_end: i32, base_start: i32, base_end
loop sections {
if src < module_end & (base_start >= base_end | ?src <= ?base_start) {
let length2 = copy_section(dest, src);
let defer length2 = copy_section(dest, src);
dest = dest + length2;
if base_start < base_end & ?src == ?base_start {
base_start = base_start + section_size(base_start);
@@ -24,7 +24,7 @@ export fn load_uw8(module_start: i32, module_end: i32, base_start: i32, base_end
}
if base_start < base_end {
let length3 = copy_section(dest, base_start);
let defer length3 = copy_section(dest, base_start);
dest = dest + length3;
base_start = base_start + length3;
branch sections;
@@ -39,10 +39,10 @@ fn section_size(ptr: i32) -> i32 {
let l = 0;
let shift = 0;
loop size {
let b = ?p;
p = p + 1;
let defer b = ?p;
l = l | ((b & 127) << shift);
shift = shift + 7;
p = p + 1;
branch_if b & 128: size;
}
p - ptr + l