Skip to content

Commit

Permalink
epoch: Fix build error with loom
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Dec 13, 2023
1 parent cb896e8 commit 6cb3a57
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crossbeam-epoch/src/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,21 @@ impl<T: ?Sized + Pointable> Atomic<T> {
///
/// let a = Atomic::<i32>::null();
/// ```
#[cfg(not(crossbeam_loom))]
pub const fn null() -> Atomic<T> {
Self {
data: AtomicUsize::new(0),
_marker: PhantomData,
}
}
/// Returns a new null atomic pointer.
#[cfg(crossbeam_loom)]
pub fn null() -> Atomic<T> {
Self {
data: AtomicUsize::new(0),
_marker: PhantomData,
}
}

/// Loads a `Shared` from the atomic pointer.
///
Expand Down

0 comments on commit 6cb3a57

Please sign in to comment.