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 18, 2023
1 parent 3b09e68 commit 53fda7f
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 @@ -194,10 +194,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 @@ -237,10 +236,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 53fda7f

Please sign in to comment.