pub const unsafe fn atomic_store<T: Copy, const ORD: AtomicOrdering, const VOLATILE: bool>(
dst: *mut T,
val: T,
)🔬This is a nightly-only experimental API. (
core_intrinsics)This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
Expand description
Stores the value at the specified memory location.
T must be an integer or pointer type.
§Safety
-
If
VOLATILEistrue, this is equivalent to Atomic::store_volatile. Refer to the documentation of that method for safety requirements. -
If
VOLATILEisfalse, this is equivalent to Atomic::from_ptr followed by Atomic::store. Refer to the documentation of Atomic::from_ptr for safety requirements.
The stabilized version of this intrinsic is available on the
atomic types via the store method. For example, AtomicBool::store.