use cast;
use clone::Clone;
use option::{Option, Some, None};
-#[cfg(stage0)]
-use sys;
use unstable::intrinsics;
use util::swap;
/// Calculate the offset from a pointer
#[inline]
-#[cfg(stage0)]
-pub fn offset<T>(ptr: *T, count: int) -> *T {
- (ptr as uint + (count as uint) * sys::size_of::<T>()) as *T
-}
-
-/// Calculate the offset from a const pointer
-#[inline]
-#[cfg(stage0)]
-pub fn const_offset<T>(ptr: *const T, count: int) -> *const T {
- (ptr as uint + (count as uint) * sys::size_of::<T>()) as *T
-}
-
-/// Calculate the offset from a mut pointer
-#[inline]
-#[cfg(stage0)]
-pub fn mut_offset<T>(ptr: *mut T, count: int) -> *mut T {
- (ptr as uint + (count as uint) * sys::size_of::<T>()) as *mut T
-}
-
-/// Calculate the offset from a pointer
-#[inline]
-#[cfg(not(stage0))]
pub fn offset<T>(ptr: *T, count: int) -> *T {
unsafe { intrinsics::offset(ptr, count) }
}
/// Calculate the offset from a const pointer
#[inline]
-#[cfg(not(stage0))]
pub fn const_offset<T>(ptr: *const T, count: int) -> *const T {
unsafe { intrinsics::offset(ptr as *T, count) }
}
/// Calculate the offset from a mut pointer
#[inline]
-#[cfg(not(stage0))]
pub fn mut_offset<T>(ptr: *mut T, count: int) -> *mut T {
unsafe { intrinsics::offset(ptr as *T, count) as *mut T }
}
pub fn atomic_umax_acqrel(dst: &mut int, src: int) -> int;
pub fn atomic_umax_relaxed(dst: &mut int, src: int) -> int;
- #[cfg(not(stage0))]
pub fn atomic_fence();
- #[cfg(not(stage0))]
pub fn atomic_fence_acq();
- #[cfg(not(stage0))]
pub fn atomic_fence_rel();
- #[cfg(not(stage0))]
pub fn atomic_fence_acqrel();
/// The size of a type in bytes.
///
/// This is implemented as an intrinsic to avoid converting to and from an
/// integer, since the conversion would throw away aliasing information.
- #[cfg(not(stage0))]
pub fn offset<T>(dst: *T, offset: int) -> *T;
/// Equivalent to the `llvm.memcpy.p0i8.0i8.i32` intrinsic, with a size of
+S 2013-08-03 18e3db7
+ freebsd-x86_64 addf91b20416bf21a7c53ea9508bc302ec957ce9
+ linux-i386 ce103c323c0a0b75d1307014f1d6f8ff4d03c873
+ linux-x86_64 6828d854d174c7b514a4350dfdd92c059df059d6
+ macos-i386 ef4b67859146cacce54367f9243b5da9f9fde386
+ macos-x86_64 936d4e170d8207b40df64c5eca3a3a27b3eee08a
+ winnt-i386 332f0181fb68fcbeaaae342d5fb22889aa902152
+
S 2013-07-31 389aba0
freebsd-x86_64 c9783bb5723404be8ae371d265bbb9a1c679e4db
linux-i386 7413d98325b23dc461ced92757e5e19bec750dbd