Skip to content

Commit

Permalink
📝 add ptr_eq api
Browse files Browse the repository at this point in the history
  • Loading branch information
Xudong-Huang committed Nov 25, 2024
1 parent f0a2e5d commit 0dd8a6a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/epoch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ pub struct RcuReader<T> {
ptr: *const T,
}

impl<T> RcuReader<T> {
/// returns true if the underlying ptr is the same one
pub fn ptr_eq(&self, other: &RcuReader<T>) -> bool {
self.ptr == other.ptr
}
}

impl<T> Deref for RcuReader<T> {
type Target = T;

Expand Down

0 comments on commit 0dd8a6a

Please sign in to comment.