refactor: propagate CanGc arguments through callers (#35591)

Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
This commit is contained in:
Auguste Baum 2025-02-23 01:34:51 +01:00 committed by GitHub
parent 02199520f2
commit b0b0289014
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
74 changed files with 403 additions and 275 deletions

View file

@ -501,14 +501,14 @@ impl WorkletThread {
should_gc: false,
gc_threshold: MIN_GC_THRESHOLD,
});
thread.run();
thread.run(CanGc::note());
})
.expect("Couldn't start worklet thread");
control_sender
}
/// The main event loop for a worklet thread
fn run(&mut self) {
fn run(&mut self, can_gc: CanGc) {
loop {
// The handler for data messages
let message = self.role.receiver.recv().unwrap();
@ -552,10 +552,10 @@ impl WorkletThread {
// try to become the cold backup.
if self.role.is_cold_backup {
if let Some(control) = self.control_buffer.take() {
self.process_control(control, CanGc::note());
self.process_control(control, can_gc);
}
while let Ok(control) = self.control_receiver.try_recv() {
self.process_control(control, CanGc::note());
self.process_control(control, can_gc);
}
self.gc();
} else if self.control_buffer.is_none() {