diff --git a/rust/kernel/sync/arc.rs b/rust/kernel/sync/arc.rs index 1b0734fdf6a7..b03d84f7ce87 100644 --- a/rust/kernel/sync/arc.rs +++ b/rust/kernel/sync/arc.rs @@ -221,6 +221,11 @@ impl Arc { // reference can be created. unsafe { ArcBorrow::new(self.ptr) } } + + /// Compare whether two [`Arc`] pointers reference the same underlying object. + pub fn ptr_eq(this: &Self, other: &Self) -> bool { + core::ptr::eq(this.ptr.as_ptr(), other.ptr.as_ptr()) + } } impl ForeignOwnable for Arc {