use { crate::host::TrapHandler, alloc::vec::Vec, hbvm::{validate::validate, vm::Vm}, }; pub struct Scheduler<'a> { data: Vec>, } impl Scheduler<'_> { fn new_process(&mut self, program: Vec) { #[allow(clippy::redundant_else)] if let Err(e) = validate(&program) { log::error!("Program validation error: {e:?}"); } else { log::info!("valid program"); unsafe { let mut vm = Vm::new_unchecked(&program, TrapHandler); vm.memory.insert_test_page(); self.data.push(vm); } } } }