Creates a pointer by calculating an offset from another one.
unsafe extern "rust-intrinsic" fn offset<T>(dst: *const T, offset: isize) -> *const T
| Name | Description |
|---|---|
| dst | The original pointer. |
| offset | The offset to be added to the original pointer. |
Returns the offset pointer.
The offset argument is in units of T, not in byte units. If dst is not a valid pointer, or dst + offset does not point into the same object, or dst + offset overflows, the behavior is undefined.
Using this function instead of casting to integers can enable more optimizations.