Optimized to avoid cloning heap values
This commit is contained in:
parent
8b3a3bebe7
commit
69f91170f6
@ -65,17 +65,13 @@ fn syscall(machine: &mut Machine, system: &mut System) -> Result<MachineOk, Mach
|
||||
match call_type {
|
||||
SC_SHUTDOWN => Ok(MachineOk::Shutdown),
|
||||
SC_EXIT => {
|
||||
match &system.get_thread_manager().g_current_thread {
|
||||
Some(th) => {
|
||||
let th = Rc::clone(th);
|
||||
let th = match &system.get_thread_manager().g_current_thread {
|
||||
Some(th) => th,
|
||||
None => Err("Current thread is None".into())
|
||||
}?;
|
||||
system.get_thread_manager().thread_finish(machine, th);
|
||||
Ok(MachineOk::Ok)
|
||||
},
|
||||
None => {
|
||||
Err("Current thread is None".into())
|
||||
}
|
||||
}
|
||||
},
|
||||
SC_EXEC => todo!(),
|
||||
SC_JOIN => todo!(),
|
||||
SC_CREATE => todo!(),
|
||||
|
Loading…
Reference in New Issue
Block a user