Byte-wise atomic memcpy.
This is an attempt to implement equivalent of C++ "P1478R1: Byte-wise atomic memcpy" in Rust.
This is expected to allow algorithms such as Seqlock and Chase-Lev deque to be implemented without UB of data races. See P1478R1 for more.
atomic_load
is possible to produce an assembly roughly equivalent to the case of using volatile read + atomic fence on many platforms. (e.g., aarch64, riscv64. See tests/asm-test/asm
directory for more).atomic_load
for more.) It is possible that there is still room for improvement, especially on non-x8664 platforms.AtomicU64
is available.-Zmiri-check-number-validity
. This will probably not be resolved until something like AtomicMaybeUninit
is supported. Note: Due to Miri does not track uninitialized bytes on a per byte basis for partially initialized scalars, Miri may report this case as an access to an uninitialized byte, regardless of whether the uninitialized byte is actually accessed or not.Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.