about summary refs log tree commit diff
path: root/src/libstd/rt
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2014-05-12 02:51:00 -0400
committerDaniel Micay <danielmicay@gmail.com>2014-05-12 02:52:32 -0400
commit8b912bc56be35149a405752f134b8b659366a35c (patch)
tree2bed14bec41fcbba6737ef3199623b81e679f0ac /src/libstd/rt
parent72fc4a5eb72b8ba96dba66400c7eecac93b0b252 (diff)
downloadrust-8b912bc56be35149a405752f134b8b659366a35c.tar.gz
rust-8b912bc56be35149a405752f134b8b659366a35c.zip
register snapshots
Diffstat (limited to 'src/libstd/rt')
-rw-r--r--src/libstd/rt/heap.rs38
1 files changed, 2 insertions, 36 deletions
diff --git a/src/libstd/rt/heap.rs b/src/libstd/rt/heap.rs
index b729fb38035..e616b9b8beb 100644
--- a/src/libstd/rt/heap.rs
+++ b/src/libstd/rt/heap.rs
@@ -114,15 +114,7 @@ pub fn stats_print() {
 }
 
 /// The allocator for unique pointers.
-#[cfg(stage0)]
-#[lang="exchange_malloc"]
-#[inline(always)]
-pub unsafe fn exchange_malloc_(size: uint) -> *mut u8 {
-    exchange_malloc(size)
-}
-
-/// The allocator for unique pointers.
-#[cfg(not(test), not(stage0))]
+#[cfg(not(test))]
 #[lang="exchange_malloc"]
 #[inline(always)]
 pub unsafe fn exchange_malloc_(size: uint, align: uint) -> *mut u8 {
@@ -130,23 +122,6 @@ pub unsafe fn exchange_malloc_(size: uint, align: uint) -> *mut u8 {
 }
 
 /// The allocator for unique pointers.
-#[cfg(stage0)]
-#[inline]
-pub unsafe fn exchange_malloc(size: uint) -> *mut u8 {
-    // The compiler never calls `exchange_free` on ~ZeroSizeType, so zero-size
-    // allocations can point to this `static`. It would be incorrect to use a null
-    // pointer, due to enums assuming types like unique pointers are never null.
-    static EMPTY: () = ();
-
-    if size == 0 {
-        &EMPTY as *() as *mut u8
-    } else {
-        allocate(size, 8)
-    }
-}
-
-/// The allocator for unique pointers.
-#[cfg(not(stage0))]
 #[inline]
 pub unsafe fn exchange_malloc(size: uint, align: uint) -> *mut u8 {
     // The compiler never calls `exchange_free` on ~ZeroSizeType, so zero-size
@@ -187,16 +162,7 @@ unsafe fn closure_exchange_malloc(drop_glue: fn(*mut u8), size: uint, align: uin
 #[no_mangle]
 #[doc(hidden)]
 #[deprecated]
-#[cfg(stage0, not(test))]
-pub unsafe extern "C" fn rust_malloc(size: uint) -> *mut u8 {
-    exchange_malloc(size)
-}
-
-// hack for libcore
-#[no_mangle]
-#[doc(hidden)]
-#[deprecated]
-#[cfg(not(stage0), not(test))]
+#[cfg(not(test))]
 pub unsafe extern "C" fn rust_malloc(size: uint, align: uint) -> *mut u8 {
     exchange_malloc(size, align)
 }