Open
Description
In Fuchsia, we're doing an update of our vendored version of crossbeam. As part of our review, we found a number of unsafe
blocks that was hard to audit due to a lack of a comment explaining why it was safe.
- L38 - it's unclear why it's safe for
Buffer
to implementSend
for all types, rather than justSend
types. - L895 and L915 - What guarantees that batch_size is less than or equal to the buffer length? Does the epoch guard on line 881 guarantee that the buffer size can't change?
- L1350 - this is a large block of unsafe code. Could a comment be added to explain why it's safe?
- L287 and L395 - could you document the ordering around loading and storing the front and back pointers? Sometimes you use
Relaxed
, and sometimes you useAcquire
, and it's difficult to tell if this is correct or an accident.