Skip to content

Commit

Permalink
Add # Safety section to cast_ptr_to_slice_mut's doc
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanson committed Nov 27, 2024
1 parent 47fac9a commit 4119bfc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions definitions/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ impl AsmCoreMachine {
}

/// Provides similar functionality to `cast_ptr_to_slice` but returns mut slice.
///
/// # Safety
///
/// Same as `cast_ptr_to_slice`.
pub unsafe fn cast_ptr_to_slice_mut(&self, ptr: u64, offset: usize, size: usize) -> &mut [u8] {
let ptr = ptr as *mut u8;
let ptr = ptr.add(offset);
Expand Down

0 comments on commit 4119bfc

Please sign in to comment.