rustc_data_structures: Explicitly check for 64-bit atomics support
Instead of keeping a list of architectures which have native support for 64-bit atomics, just use #[cfg(target_has_atomic = "64")] and its inverted counterpart to determine whether we need to use portable AtomicU64 on the target architecture.
This commit is contained in:
parent
9c3bc805dd
commit
ab1b48ef2a
3 changed files with 7 additions and 9 deletions
|
@ -147,14 +147,13 @@ cfg_match! {
|
|||
[crate::owned_slice::OwnedSlice]
|
||||
);
|
||||
|
||||
// MIPS, PowerPC and SPARC platforms with 32-bit pointers do not
|
||||
// have AtomicU64 type.
|
||||
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc", target_arch = "sparc")))]
|
||||
// Use portable AtomicU64 for targets without native 64-bit atomics
|
||||
#[cfg(target_has_atomic = "64")]
|
||||
already_sync!(
|
||||
[std::sync::atomic::AtomicU64]
|
||||
);
|
||||
|
||||
#[cfg(any(target_arch = "mips", target_arch = "powerpc", target_arch = "sparc"))]
|
||||
#[cfg(not(target_has_atomic = "64"))]
|
||||
already_sync!(
|
||||
[portable_atomic::AtomicU64]
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue