Function core::intrinsics::arith_offset [−][src]
pub unsafe extern "rust-intrinsic" fn arith_offset<T>(
dst: *const T,
offset: isize
) -> *const T
🔬 This is a nightly-only experimental API. (core_intrinsics
)
intrinsics are unlikely to ever be stabilized, instead they should be used through stabilized interfaces in the rest of the standard library
Expand description
计算与指针的偏移量 (可能会自动换行)。
这被实现为内部函数,以避免与整数进行相互转换,因为该转换会禁止某些优化。
Safety
与 offset
内部函数不同,此内部函数不会限制结果指针指向已分配对象的末尾或指向该对象末尾一个字节,并且使用二进制补码算法进行换行。
结果值不一定有效地用于实际访问内存。
此内部函数的稳定版本为 pointer::wrapping_offset
。