Skip to content

Commit

Permalink
tweak safety doc
Browse files Browse the repository at this point in the history
  • Loading branch information
fathyb committed Mar 20, 2023
1 parent 51273ea commit a834557
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/submit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,9 @@ impl<'a> Submitter<'a> {
///
/// # Safety
///
/// This function is unsafe because improper use may lead to memory problems.
/// For example, a use-after-free may occur if `iov_base` contains a pointer freed
/// before unregistering the buffer through [`unregister_buffers`](Self::unregister_buffers)
/// or [`register_buffers_update_tag`](Self::register_buffers_update_tag).
/// Developers must ensure that the `iov_base` and `iov_len` values are valid and will
/// be valid until buffers are unregistered or the ring destroyed, otherwise undefined
/// behaviour may occur.
pub unsafe fn register_buffers_update_tag(
&self,
off: u32,
Expand Down Expand Up @@ -241,10 +240,9 @@ impl<'a> Submitter<'a> {
///
/// # Safety
///
/// This function is unsafe because improper use may lead to memory problems.
/// For example, a use-after-free may occur if `iov_base` contains a pointer freed
/// before unregistering the buffer through [`unregister_buffers`](Self::unregister_buffers)
/// or [`register_buffers_update_tag`](Self::register_buffers_update_tag).
/// Developers must ensure that the `iov_base` and `iov_len` values are valid and will
/// be valid until buffers are unregistered or the ring destroyed, otherwise undefined
/// behaviour may occur.
pub unsafe fn register_buffers_tags(
&self,
bufs: &[libc::iovec],
Expand Down

0 comments on commit a834557

Please sign in to comment.