mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 20:54:13 +00:00
trigger garbage collection *after* requests, not before
This commit is contained in:
parent
6a1e3e59cb
commit
118a2113c1
@ -171,7 +171,6 @@ fn main_loop_inner(
|
|||||||
let (libdata_sender, libdata_receiver) = unbounded();
|
let (libdata_sender, libdata_receiver) = unbounded();
|
||||||
loop {
|
loop {
|
||||||
let _p = profile("loop_turn");
|
let _p = profile("loop_turn");
|
||||||
state.maybe_collect_garbage();
|
|
||||||
|
|
||||||
log::trace!("selecting");
|
log::trace!("selecting");
|
||||||
let event = select! {
|
let event = select! {
|
||||||
@ -193,13 +192,17 @@ fn main_loop_inner(
|
|||||||
}
|
}
|
||||||
let mut state_changed = false;
|
let mut state_changed = false;
|
||||||
match event {
|
match event {
|
||||||
Event::Task(task) => on_task(task, msg_sender, pending_requests),
|
Event::Task(task) => {
|
||||||
|
on_task(task, msg_sender, pending_requests);
|
||||||
|
state.maybe_collect_garbage();
|
||||||
|
}
|
||||||
Event::Vfs(task) => {
|
Event::Vfs(task) => {
|
||||||
state.vfs.write().handle_task(task);
|
state.vfs.write().handle_task(task);
|
||||||
state_changed = true;
|
state_changed = true;
|
||||||
}
|
}
|
||||||
Event::Lib(lib) => {
|
Event::Lib(lib) => {
|
||||||
state.add_lib(lib);
|
state.add_lib(lib);
|
||||||
|
state.maybe_collect_garbage();
|
||||||
in_flight_libraries -= 1;
|
in_flight_libraries -= 1;
|
||||||
}
|
}
|
||||||
Event::Msg(msg) => match msg {
|
Event::Msg(msg) => match msg {
|
||||||
|
Loading…
Reference in New Issue
Block a user