Skip to content

Document unsafety use in crossbeam-deque #688

Open
@erickt

Description

@erickt

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 implement Send for all types, rather than just Send 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 use Acquire, and it's difficult to tell if this is correct or an accident.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions