(Go: >> BACK << -|- >> HOME <<)

Skip to content

Commit

Permalink
Fix SlotMap::try_collect not checking the guard's global
Browse files Browse the repository at this point in the history
  • Loading branch information
marc0246 committed Jul 8, 2024
1 parent edf8d49 commit a4025e8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,12 @@ impl<T, C: Collector<T>> SlotMap<T, C> {
}
}

/// # Panics
///
/// Panics if `guard.global()` does not equal `self.global()`.
pub fn try_collect(&self, guard: &epoch::Guard<'_>) {
assert_eq!(guard.global(), &self.global);

let epoch = guard.epoch();
let queued_list = &self.free_list_queue[((epoch >> 1) & 1) as usize];
let mut queued_state = queued_list.load(Acquire);
Expand Down

0 comments on commit a4025e8

Please sign in to comment.