Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tustvold committed Dec 1, 2024
1 parent 5d1abfe commit a310c31
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions arrow-buffer/src/buffer/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,14 @@ impl MutableBuffer {
}
}


/// Creates a non-null pointer with alignment of [`ALIGNMENT`]
///
/// This is similar to [`NonNull::dangling`]
#[inline]
pub(crate) fn dangling_ptr() -> NonNull<u8> {
// SAFETY: ALIGNMENT is a non-zero usize which is then casted
// to a *mut T. Therefore, `ptr` is not null and the conditions for
// SAFETY: ALIGNMENT is a non-zero usize which is then cast
// to a *mut u8. Therefore, `ptr` is not null and the conditions for
// calling new_unchecked() are respected.
#[cfg(miri)]
{
Expand Down

0 comments on commit a310c31

Please sign in to comment.