1
0
Fork 0
forked from koniifer/ableos

fix compile error

This commit is contained in:
able 2023-06-26 18:42:55 -05:00
parent 567871d18e
commit 06868b516f

View file

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