diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6155c98..e7f1e48 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -49,7 +49,7 @@ jobs: - script: cargo miri test displayName: cargo miri test env: - MIRIFLAGS: -Zmiri-ignore-leaks + MIRIFLAGS: "-Zmiri-ignore-leaks -Zmiri-disable-isolation" - job: loom displayName: "Run loom on test suite" pool: diff --git a/src/domain.rs b/src/domain.rs index 370f9e3..e25696b 100644 --- a/src/domain.rs +++ b/src/domain.rs @@ -9,12 +9,12 @@ use core::sync::atomic::Ordering; // `SYNC_TIME_PERIOD` nanoseconds. The next time we should run reclamation is stored in // `due_time` inside `Domain`. On `no_std` we don't (yet) have access to time so this feature is // disabled. Also on platforms with < 64 bits, we can only store 2^32 nanoseconds -> ~4 seconds or -// less, so this feature is also disabled. Additionally, miri can't support time because of -// system calls (perhaps this can be mocked), and loom can't support time for reasons of determinism. +// less, so this feature is also disabled. Additionally, loom can't support time for reasons of +// determinism. -#[cfg(all(feature = "std", target_pointer_width = "64", not(miri), not(loom)))] +#[cfg(all(feature = "std", target_pointer_width = "64", not(loom)))] const SYNC_TIME_PERIOD: u64 = std::time::Duration::from_nanos(2000000000).as_nanos() as u64; -#[cfg(all(feature = "std", target_pointer_width = "64", not(miri), not(loom)))] +#[cfg(all(feature = "std", target_pointer_width = "64", not(loom)))] use crate::sync::atomic::AtomicU64; #[cfg(loom)] @@ -62,7 +62,7 @@ pub struct Domain { hazptrs: HazPtrRecords, untagged: [RetiredList; NUM_SHARDS], family: PhantomData, - #[cfg(all(feature = "std", target_pointer_width = "64", not(miri), not(loom)))] + #[cfg(all(feature = "std", target_pointer_width = "64", not(loom)))] due_time: AtomicU64, nbulk_reclaims: AtomicUsize, count: AtomicIsize, @@ -111,7 +111,7 @@ macro_rules! new { }, untagged, count: AtomicIsize::new(0), - #[cfg(all(feature = "std", target_pointer_width = "64", not(miri), not(loom)))] + #[cfg(all(feature = "std", target_pointer_width = "64", not(loom)))] due_time: AtomicU64::new(0), nbulk_reclaims: AtomicUsize::new(0), family: PhantomData, @@ -368,7 +368,7 @@ impl Domain { .compare_exchange_weak(rcount, 0, Ordering::AcqRel, Ordering::Relaxed) { Ok(_) => { - #[cfg(all(feature = "std", target_pointer_width = "64", not(miri), not(loom)))] + #[cfg(all(feature = "std", target_pointer_width = "64", not(loom)))] { self.due_time .store(Self::now() + SYNC_TIME_PERIOD, Ordering::Release); @@ -381,7 +381,7 @@ impl Domain { 0 } - #[cfg(all(feature = "std", target_pointer_width = "64", not(miri), not(loom)))] + #[cfg(all(feature = "std", target_pointer_width = "64", not(loom)))] fn check_due_time(&self) -> isize { let time = Self::now(); let due = self.due_time.load(Ordering::Acquire); @@ -409,7 +409,7 @@ impl Domain { // TODO: Implement some kind of mock time for no_std. // Currently we reclaim only based on rcount on no_std // (also the reason for allow unused_mut) - #[cfg(all(feature = "std", target_pointer_width = "64", not(miri), not(loom)))] + #[cfg(all(feature = "std", target_pointer_width = "64", not(loom)))] { rcount = self.check_due_time(); } @@ -553,7 +553,7 @@ impl Domain { 0 } - #[cfg(all(feature = "std", target_pointer_width = "64", not(miri), not(loom)))] + #[cfg(all(feature = "std", target_pointer_width = "64", not(loom)))] fn now() -> u64 { use std::convert::TryFrom; u64::try_from( diff --git a/src/sync.rs b/src/sync.rs index ad96bec..2c300bd 100644 --- a/src/sync.rs +++ b/src/sync.rs @@ -10,9 +10,9 @@ pub(crate) use loom::thread::yield_now; #[cfg(not(loom))] pub(crate) mod atomic { - pub(crate) use core::sync::atomic::{fence, AtomicIsize, AtomicPtr, AtomicUsize}; #[cfg(target_pointer_width = "64")] pub use core::sync::atomic::AtomicU64; + pub(crate) use core::sync::atomic::{fence, AtomicIsize, AtomicPtr, AtomicUsize}; } #[cfg(all(not(loom), feature = "std"))] pub(crate) use std::thread::yield_now;