Calculates the offset from a device pointer using wrapping arithmetic. `count` is in units of T; eg. a `count` of 3 represents a pointer offset of `3 * size_of:: ()` bytes. # Safety The resulting pointer does not need to be in bounds, but it is potentially hazardous to dereference (which requires `unsafe`). In particular, the resulting pointer may *not* be used to access a different allocated
(self, count: isize)
| 167 | /// } |
| 168 | /// ``` |
| 169 | pub fn wrapping_offset(self, count: isize) -> Self |
| 170 | where |
| 171 | T: Sized, |
| 172 | { |
| 173 | let ptr = self |
| 174 | .ptr |
| 175 | .wrapping_add((count as usize * size_of::<T>()) as u64); |
| 176 | Self { |
| 177 | ptr, |
| 178 | marker: PhantomData, |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | /// Calculates the offset from a pointer (convenience for `.offset(count as isize)`). |
| 183 | /// |
no test coverage detected