Calculates the offset from a device pointer. `count` is in units of T; eg. a `count` of 3 represents a pointer offset of `3 * size_of:: ()` bytes. # Safety If any of the following conditions are violated, the result is Undefined Behavior: Both the starting and resulting pointer must be either in bounds or one byte past the end of *the same* allocated object. The computed offset, **in bytes*
(self, count: isize)
| 126 | /// } |
| 127 | /// ``` |
| 128 | pub unsafe fn offset(self, count: isize) -> Self |
| 129 | where |
| 130 | T: Sized, |
| 131 | { |
| 132 | let ptr = self.ptr + (count as usize * size_of::<T>()) as u64; |
| 133 | Self { |
| 134 | ptr, |
| 135 | marker: PhantomData, |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | /// Calculates the offset from a device pointer using wrapping arithmetic. |
| 140 | /// |
no outgoing calls
no test coverage detected