You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
That also does not seem to include any obligations that need to be upheld by the caller of the method. If there are none, the function can be made safe while keeping just the trait unsafe.
...which makes it sound like even a subsequent call to read_buffer would be unsafe.
Did you mean write_buffer ?
The functions are unsafe to allow for implementations for types like Vec, just like StableDeref, but we decided to be more clear since we deal with raw pointers.
All of the buffer access methods,
write_buffer
,read_buffer
, and their static counterparts, areunsafe
, 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:The docs for
read_buffer
are:...which makes it sound like even a subsequent call to
read_buffer
would be unsafe.The text was updated successfully, but these errors were encountered: