Skip to content

Buffer access methods do not document the caller's safety obligations #15

@jonas-schievink

Description

@jonas-schievink

All of the buffer access methods, write_buffer, read_buffer, and their static counterparts, are unsafe, but the Safety section in their docs does not explain what invariants the caller needs to uphold for the call to be safe.

The safety docs for write_buffer are:

Once this method has been called, it is unsafe to call any &mut self methods, except for write_buffer, on this object as long as the returned value is in use (by DMA).

The docs for read_buffer are:

Once this method has been called, it is unsafe to call any &mut self methods on this object as long as the returned value is in use (by DMA).

...which makes it sound like even a subsequent call to read_buffer would be unsafe.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions