Function same_allocation

Source
pub fn same_allocation<T: ?Sized>(ptr1: *const T, ptr2: *const T) -> bool
Expand description

Check if two pointers points to the same allocated object, and that both pointers are in bounds of that object.

A pointer is still considered in-bounds if it points to 1-byte past the allocation.