Skip to content

Commit

Permalink
Replace self-rolled LinkedList with the one from std
Browse files Browse the repository at this point in the history
  • Loading branch information
skogseth committed Sep 26, 2023
1 parent 99d42bb commit 0d8b45c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 455 deletions.
7 changes: 4 additions & 3 deletions src/core.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use std::collections::LinkedList;
use std::ops::Deref;
use std::ptr::{addr_of, NonNull};
use std::sync::atomic::{AtomicPtr, AtomicUsize, Ordering::*};

use crate::linked_list::LinkedList;

/// Holds a reference to an object protected by a hazard pointer
pub struct RefHandle<'hzrd, T> {
value: &'hzrd T,
Expand Down Expand Up @@ -150,7 +149,9 @@ impl HzrdPtrs {
}
}

let hzrd_ptr = self.0.push_back(HzrdPtr::new());
self.0.push_back(HzrdPtr::new());
let hzrd_ptr = self.0.back().expect("expected non-empty list");

NonNull::from(hzrd_ptr)
}

Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ There is no way to acquire a mutable borrow to the underlying value as that inhe

mod cell;
mod core;
mod linked_list;
mod utils;

pub mod pair;
Expand Down
Loading

0 comments on commit 0d8b45c

Please sign in to comment.