Conversation
|
cc @lhecker Please review. |
|
Test snippet: extern crate coio;
use coio::Scheduler;
fn main() {
Scheduler::new()
.run(|| {
loop {
let hdl = Scheduler::spawn(|| {
Scheduler::sched();
let _x = 1;
panic!("Just panic!");
});
assert!(hdl.join().is_err());
}
})
.unwrap();
}This process will not allocate memory continuously. BTW: cc @lhecker , if you run this code with
I think it is because when the
|
This bug exists because in
coroutine_entry, we cannot know whether thecallback()is panicked. So we will continue the execution and set the state toState::Finishedand yield back, which will cause memory leak, because thecoroutine_exitis not called!!