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 Nov 5, 2023
1 parent 3e91cdd commit 18afbb6
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 @@ -302,12 +302,21 @@ impl<T: ?Sized + Pointable> Atomic<T> {
///
/// let a = Atomic::<i32>::null();
/// ```
#[cfg(not(crossbeam_loom))]
pub const fn null() -> Atomic<T> {
Self {
data: AtomicPtr::new(ptr::null_mut()),
_marker: PhantomData,
}
}
/// Returns a new null atomic pointer.
#[cfg(crossbeam_loom)]
pub fn null() -> Atomic<T> {
Self {
data: AtomicPtr::new(ptr::null_mut()),
_marker: PhantomData,
}
}

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

0 comments on commit 18afbb6

Please sign in to comment.