Skip to content

Commit 18afbb6

Browse files
committed
epoch: Fix build error with loom
1 parent 3e91cdd commit 18afbb6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

crossbeam-epoch/src/atomic.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,12 +302,21 @@ impl<T: ?Sized + Pointable> Atomic<T> {
302302
///
303303
/// let a = Atomic::<i32>::null();
304304
/// ```
305+
#[cfg(not(crossbeam_loom))]
305306
pub const fn null() -> Atomic<T> {
306307
Self {
307308
data: AtomicPtr::new(ptr::null_mut()),
308309
_marker: PhantomData,
309310
}
310311
}
312+
/// Returns a new null atomic pointer.
313+
#[cfg(crossbeam_loom)]
314+
pub fn null() -> Atomic<T> {
315+
Self {
316+
data: AtomicPtr::new(ptr::null_mut()),
317+
_marker: PhantomData,
318+
}
319+
}
311320

312321
/// Loads a `Shared` from the atomic pointer.
313322
///

0 commit comments

Comments
 (0)