Skip to main content

stack/
util.rs

1pub trait PointerExt {
2    unsafe fn uoffset(self, off: usize) -> Self;
3}
4
5impl<T> PointerExt for *const T {
6    #[inline]
7    unsafe fn uoffset(self, off: usize) -> Self {
8        self.offset(off as isize)
9    }
10}
11
12impl<T> PointerExt for *mut T {
13    #[inline]
14    unsafe fn uoffset(self, off: usize) -> Self {
15        self.offset(off as isize)
16    }
17}