From 18afbb6ed2f98e55ae5cc10578e54762232a2437 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sun, 5 Nov 2023 22:23:07 +0900 Subject: [PATCH] epoch: Fix build error with loom --- crossbeam-epoch/src/atomic.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crossbeam-epoch/src/atomic.rs b/crossbeam-epoch/src/atomic.rs index 706ba86a4..028b9bf9c 100644 --- a/crossbeam-epoch/src/atomic.rs +++ b/crossbeam-epoch/src/atomic.rs @@ -302,12 +302,21 @@ impl Atomic { /// /// let a = Atomic::::null(); /// ``` + #[cfg(not(crossbeam_loom))] pub const fn null() -> Atomic { Self { data: AtomicPtr::new(ptr::null_mut()), _marker: PhantomData, } } + /// Returns a new null atomic pointer. + #[cfg(crossbeam_loom)] + pub fn null() -> Atomic { + Self { + data: AtomicPtr::new(ptr::null_mut()), + _marker: PhantomData, + } + } /// Loads a `Shared` from the atomic pointer. ///