Assert that `ptr` is sufficiently aligned to reference a value of `T`. In release mode, this is a no-op.
(ptr: *const Byte)
| 1031 | /// |
| 1032 | /// In release mode, this is a no-op. |
| 1033 | fn assert_alignment<T>(ptr: *const Byte) { |
| 1034 | debug_assert_eq!( |
| 1035 | ptr as usize % mem::align_of::<T>(), |
| 1036 | 0, |
| 1037 | "Wanted a PageOffset with align 0x{:x} (for {}) but found 0x{:x}", |
| 1038 | mem::align_of::<T>(), |
| 1039 | std::any::type_name::<T>(), |
| 1040 | ptr as usize, |
| 1041 | ); |
| 1042 | } |
| 1043 | |
| 1044 | /// Returns a reference to the [`T`] pointed to at by `offset`. |
| 1045 | /// |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…