mirror of
https://github.com/Noratrieb/dilaria.git
synced 2026-01-16 10:25:02 +01:00
more vm and alloc and intern
This commit is contained in:
parent
e58e6e3dc4
commit
dc26b52bd2
8 changed files with 200 additions and 112 deletions
20
src/vm.rs
Normal file
20
src/vm.rs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
use crate::bytecode::FnBlock;
|
||||
use crate::gc::RtAlloc;
|
||||
|
||||
type VmResult = Result<(), ()>;
|
||||
|
||||
pub fn execute<'bc>(bytecode: &'bc [FnBlock<'bc>], alloc: RtAlloc) -> Result<(), ()> {
|
||||
let _vm = Vm {
|
||||
blocks: bytecode,
|
||||
current: bytecode.first().ok_or(())?,
|
||||
alloc,
|
||||
};
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
struct Vm<'bc> {
|
||||
blocks: &'bc [FnBlock<'bc>],
|
||||
current: &'bc FnBlock<'bc>,
|
||||
alloc: RtAlloc,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue