aboutsummaryrefslogtreecommitdiffstats
path: root/bytecode/src/bytecode.rs
diff options
context:
space:
mode:
authorRose Hogenson <rhogenson@posteo.net>2022-08-22 20:05:23 -0700
committerRose Hogenson <rhogenson@posteo.net>2022-08-22 20:05:23 -0700
commitfc565d78596a44f6e6253932d726c830e3f6e509 (patch)
tree036bdefd0932a97a73d6ccb2ffd59b39d0023709 /bytecode/src/bytecode.rs
parent26ed2bcec620c639faef25c75e4076888068e45e (diff)
downloadchromatopelma-fc565d78596a44f6e6253932d726c830e3f6e509.tar.zst
Simplify the heap.
Garbage collection is no longer recursive, heap takes an offset explicitly, and we use the vector length to store the free pointer.
Diffstat (limited to 'bytecode/src/bytecode.rs')
-rw-r--r--bytecode/src/bytecode.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/bytecode/src/bytecode.rs b/bytecode/src/bytecode.rs
index e784d57..41302ad 100644
--- a/bytecode/src/bytecode.rs
+++ b/bytecode/src/bytecode.rs
@@ -183,7 +183,7 @@ impl Interpreter {
if o < 0 {
return Err(String::from("pointer offset can't be negative"));
}
- let result = self.heap.peek(p.offset(usize::try_from(o).unwrap()))?;
+ let result = self.heap.peek(p, usize::try_from(o).unwrap())?;
self.set_arg(dest, result);
Ok(())
}
@@ -195,7 +195,7 @@ impl Interpreter {
if o < 0 {
return Err(String::from("pointer offset can't be negative"));
}
- self.heap.poke(w, p.offset(usize::try_from(o).unwrap()))?;
+ self.heap.poke(w, p, usize::try_from(o).unwrap())?;
Ok(())
}