Skip to content

Commit

Permalink
Update Safety doc on Image::from_ptr to mention mutability
Browse files Browse the repository at this point in the history
  • Loading branch information
ids1024 committed Dec 3, 2024
1 parent c15b587 commit a242323
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pixman/src/image/bits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,9 @@ impl<'bits, 'alpha> Image<'bits, 'alpha> {
///
/// The pointer is expected to be valid and have a ref-count of at least one.
/// Ownership of the pointer is transferred and unref will be called on drop.
///
/// Any other references to the `pixman_image_t` must not be mutated while this
/// `Image` exists, including changes to the reference count.
pub unsafe fn from_ptr(ptr: *mut ffi::pixman_image_t) -> Self {
Self {
image: unsafe { ImageRef::from_ptr(ptr) },
Expand Down

0 comments on commit a242323

Please sign in to comment.