register snapshots
This commit is contained in:
parent
34101d2320
commit
9f74217d80
@ -13,8 +13,6 @@
|
|||||||
use cast;
|
use cast;
|
||||||
use clone::Clone;
|
use clone::Clone;
|
||||||
use option::{Option, Some, None};
|
use option::{Option, Some, None};
|
||||||
#[cfg(stage0)]
|
|
||||||
use sys;
|
|
||||||
use unstable::intrinsics;
|
use unstable::intrinsics;
|
||||||
use util::swap;
|
use util::swap;
|
||||||
|
|
||||||
@ -26,42 +24,18 @@ use uint;
|
|||||||
|
|
||||||
/// Calculate the offset from a pointer
|
/// Calculate the offset from a pointer
|
||||||
#[inline]
|
#[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 {
|
pub fn offset<T>(ptr: *T, count: int) -> *T {
|
||||||
unsafe { intrinsics::offset(ptr, count) }
|
unsafe { intrinsics::offset(ptr, count) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Calculate the offset from a const pointer
|
/// Calculate the offset from a const pointer
|
||||||
#[inline]
|
#[inline]
|
||||||
#[cfg(not(stage0))]
|
|
||||||
pub fn const_offset<T>(ptr: *const T, count: int) -> *const T {
|
pub fn const_offset<T>(ptr: *const T, count: int) -> *const T {
|
||||||
unsafe { intrinsics::offset(ptr as *T, count) }
|
unsafe { intrinsics::offset(ptr as *T, count) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Calculate the offset from a mut pointer
|
/// Calculate the offset from a mut pointer
|
||||||
#[inline]
|
#[inline]
|
||||||
#[cfg(not(stage0))]
|
|
||||||
pub fn mut_offset<T>(ptr: *mut T, count: int) -> *mut T {
|
pub fn mut_offset<T>(ptr: *mut T, count: int) -> *mut T {
|
||||||
unsafe { intrinsics::offset(ptr as *T, count) as *mut T }
|
unsafe { intrinsics::offset(ptr as *T, count) as *mut T }
|
||||||
}
|
}
|
||||||
|
@ -509,7 +509,7 @@ pub unsafe fn atomic_xor<T>(dst: &mut T, val: T, order: Ordering) -> T {
|
|||||||
*
|
*
|
||||||
* Accepts `Acquire`, `Release`, `AcqRel` and `SeqCst` orderings.
|
* Accepts `Acquire`, `Release`, `AcqRel` and `SeqCst` orderings.
|
||||||
*/
|
*/
|
||||||
#[inline] #[cfg(not(stage0))]
|
#[inline]
|
||||||
pub fn fence(order: Ordering) {
|
pub fn fence(order: Ordering) {
|
||||||
unsafe {
|
unsafe {
|
||||||
match order {
|
match order {
|
||||||
|
@ -256,13 +256,9 @@ extern "rust-intrinsic" {
|
|||||||
pub fn atomic_umax_acqrel(dst: &mut int, src: int) -> int;
|
pub fn atomic_umax_acqrel(dst: &mut int, src: int) -> int;
|
||||||
pub fn atomic_umax_relaxed(dst: &mut int, src: int) -> int;
|
pub fn atomic_umax_relaxed(dst: &mut int, src: int) -> int;
|
||||||
|
|
||||||
#[cfg(not(stage0))]
|
|
||||||
pub fn atomic_fence();
|
pub fn atomic_fence();
|
||||||
#[cfg(not(stage0))]
|
|
||||||
pub fn atomic_fence_acq();
|
pub fn atomic_fence_acq();
|
||||||
#[cfg(not(stage0))]
|
|
||||||
pub fn atomic_fence_rel();
|
pub fn atomic_fence_rel();
|
||||||
#[cfg(not(stage0))]
|
|
||||||
pub fn atomic_fence_acqrel();
|
pub fn atomic_fence_acqrel();
|
||||||
|
|
||||||
/// The size of a type in bytes.
|
/// The size of a type in bytes.
|
||||||
@ -325,7 +321,6 @@ extern "rust-intrinsic" {
|
|||||||
///
|
///
|
||||||
/// This is implemented as an intrinsic to avoid converting to and from an
|
/// This is implemented as an intrinsic to avoid converting to and from an
|
||||||
/// integer, since the conversion would throw away aliasing information.
|
/// integer, since the conversion would throw away aliasing information.
|
||||||
#[cfg(not(stage0))]
|
|
||||||
pub fn offset<T>(dst: *T, offset: int) -> *T;
|
pub fn offset<T>(dst: *T, offset: int) -> *T;
|
||||||
|
|
||||||
/// Equivalent to the `llvm.memcpy.p0i8.0i8.i32` intrinsic, with a size of
|
/// Equivalent to the `llvm.memcpy.p0i8.0i8.i32` intrinsic, with a size of
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
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
|
S 2013-07-31 389aba0
|
||||||
freebsd-x86_64 c9783bb5723404be8ae371d265bbb9a1c679e4db
|
freebsd-x86_64 c9783bb5723404be8ae371d265bbb9a1c679e4db
|
||||||
linux-i386 7413d98325b23dc461ced92757e5e19bec750dbd
|
linux-i386 7413d98325b23dc461ced92757e5e19bec750dbd
|
||||||
|
Loading…
x
Reference in New Issue
Block a user