automatically collect garbage
This commit is contained in:
@@ -172,6 +172,7 @@ fn main_loop_inner(
|
||||
|
||||
let (libdata_sender, libdata_receiver) = unbounded();
|
||||
loop {
|
||||
state.maybe_collect_garbage();
|
||||
log::trace!("selecting");
|
||||
let event = select! {
|
||||
recv(msg_receiver) -> msg => match msg {
|
||||
@@ -207,7 +208,7 @@ fn main_loop_inner(
|
||||
};
|
||||
match req.cast::<req::CollectGarbage>() {
|
||||
Ok((id, ())) => {
|
||||
state.collect_garbadge();
|
||||
state.collect_garbage();
|
||||
let resp = RawResponse::ok::<req::CollectGarbage>(id, &());
|
||||
msg_sender.send(RawMessage::Response(resp)).unwrap()
|
||||
}
|
||||
|
||||
@@ -232,7 +232,11 @@ impl ServerWorldState {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn collect_garbadge(&mut self) {
|
||||
pub fn maybe_collect_garbage(&mut self) {
|
||||
self.analysis_host.maybe_collect_garbage()
|
||||
}
|
||||
|
||||
pub fn collect_garbage(&mut self) {
|
||||
self.analysis_host.collect_garbage()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user