Skip to content

Commit

Permalink
epoll: remove extraneous clone of ready_list
Browse files Browse the repository at this point in the history
A simplification that doesn't impact the epoll implementation's logic.

It is not necessary to clone the ready_list before reading its
`is_empty` state.

This avoids the clone step but more importantly avoids the invisible
drop step of the clone.
  • Loading branch information
FrankReh authored and oli-obk committed Oct 2, 2024
1 parent e3c3de3 commit d7695a0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/shims/unix/linux/epoll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
let epoll_file_description = epfd
.downcast::<Epoll>()
.ok_or_else(|| err_unsup_format!("non-epoll FD passed to `epoll_wait`"))?;
let binding = epoll_file_description.get_ready_list();
ready_list_empty = binding.mapping.borrow_mut().is_empty();
ready_list_empty = epoll_file_description.ready_list.mapping.borrow().is_empty();
thread_ids = epoll_file_description.thread_id.borrow_mut();
}
if timeout == 0 || !ready_list_empty {
Expand Down

0 comments on commit d7695a0

Please sign in to comment.