0.2.1 (current) Thoroughness: Medium Understanding: Medium
by yvt on 2021-09-20
This review is from Crev, a distributed system for code reviews. To add your review, set up cargo-crev
.
0.2.1 (current) Thoroughness: Medium Understanding: Medium
by yvt on 2021-09-20
Crates in the crates.io registry are tarball snapshots uploaded by crates' publishers. The registry is not using crates' git repositories. There is absolutely no guarantee that the repository URL declared by the crate belongs to the crate, or that the code in the repository is the code inside the published tarball.
To review the actual code of the crate, it's best to use cargo crev open atomic_ref
. Alternatively, you can download the tarball of atomic_ref v0.2.1 or view the source online.
This crate provides an atomic cell to store
Option<&T>
.This crate is sound and has no known issues.
AtomicRef
has the correct trait bounds forSync
/Send
-ness and employs the minimum memory ordering to make sure that, when a reference that was recently written through was stored to anAtomicRef
, whoever loads that reference is guaranteed to observe the value written. (This requires acquire/release synchronization for all loads and stores onAtomicRef
. Without it, the reader could observe a stale value, causing an undefined behavior. This was recently reported by #5 and fixed by #6.)Issue: High (github.com/mystor/atomic_ref/pull/6)
Previous verions of
atomic_ref
have a bug in whichAtomicRef
's methods accept unsafe memory orderings.