Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions crossbeam-epoch/src/sync/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ mod tests {
use super::*;
use crate::{Collector, Owned};
use crossbeam_utils::thread;
use std::ptr;
use std::sync::Barrier;
use std::vec::Vec;

Expand Down Expand Up @@ -340,13 +341,13 @@ mod tests {
let mut iter = l.iter(&guard);
let maybe_e3 = iter.next();
assert!(maybe_e3.is_some());
assert!(maybe_e3.unwrap().unwrap() as *const Entry == e3.as_raw());
assert!(ptr::eq(maybe_e3.unwrap().unwrap(), e3.as_raw()));
let maybe_e2 = iter.next();
assert!(maybe_e2.is_some());
assert!(maybe_e2.unwrap().unwrap() as *const Entry == e2.as_raw());
assert!(ptr::eq(maybe_e2.unwrap().unwrap(), e2.as_raw()));
let maybe_e1 = iter.next();
assert!(maybe_e1.is_some());
assert!(maybe_e1.unwrap().unwrap() as *const Entry == e1.as_raw());
assert!(ptr::eq(maybe_e1.unwrap().unwrap(), e1.as_raw()));
assert!(iter.next().is_none());

unsafe {
Expand Down Expand Up @@ -379,10 +380,10 @@ mod tests {
let mut iter = l.iter(&guard);
let maybe_e3 = iter.next();
assert!(maybe_e3.is_some());
assert!(maybe_e3.unwrap().unwrap() as *const Entry == e3.as_raw());
assert!(ptr::eq(maybe_e3.unwrap().unwrap(), e3.as_raw()));
let maybe_e1 = iter.next();
assert!(maybe_e1.is_some());
assert!(maybe_e1.unwrap().unwrap() as *const Entry == e1.as_raw());
assert!(ptr::eq(maybe_e1.unwrap().unwrap(), e1.as_raw()));
assert!(iter.next().is_none());

unsafe {
Expand Down
4 changes: 2 additions & 2 deletions crossbeam-skiplist/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2071,7 +2071,7 @@ impl<K, V> Drop for IntoIter<K, V> {
unsafe {
// Unprotected loads are okay because this function is the only one currently using
// the skip list.
let next = (*self.node).tower[0].load(Ordering::Relaxed, epoch::unprotected());
let next = (&(*self.node).tower)[0].load(Ordering::Relaxed, epoch::unprotected());

// We can safely do this without deferring because references to
// keys & values that we give out never outlive the SkipList.
Expand Down Expand Up @@ -2102,7 +2102,7 @@ impl<K, V> Iterator for IntoIter<K, V> {
//
// Unprotected loads are okay because this function is the only one currently using
// the skip list.
let next = (*self.node).tower[0].load(Ordering::Relaxed, epoch::unprotected());
let next = (&(*self.node).tower)[0].load(Ordering::Relaxed, epoch::unprotected());

// Deallocate the current node and move to the next one.
Node::dealloc(self.node);
Expand Down
Loading