about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/heap.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/liballoc/heap.rs b/src/liballoc/heap.rs
index 40f60c365d2..631b72cb897 100644
--- a/src/liballoc/heap.rs
+++ b/src/liballoc/heap.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 // FIXME: #13994: port to the sized deallocation API when available
-// FIXME: #13996: need a way to mark the `allocate` and `reallocate` return values as `noalias`
+// FIXME: #13996: mark the `allocate` and `reallocate` return value as `noalias` and `nonnull`
 
 use core::intrinsics::{abort, cttz32};
 use core::option::{None, Option};
@@ -133,14 +133,20 @@ unsafe fn exchange_malloc(size: uint, align: uint) -> *mut u8 {
     }
 }
 
-#[cfg(not(test))]
+#[cfg(not(test), stage0)]
 #[lang="exchange_free"]
 #[inline]
-// FIXME: #13994 (rustc should pass align and size here)
 unsafe fn exchange_free(ptr: *mut u8) {
     deallocate(ptr, 0, 8);
 }
 
+#[cfg(not(test), not(stage0))]
+#[lang="exchange_free"]
+#[inline]
+unsafe fn exchange_free(ptr: *mut u8, size: uint, align: uint) {
+    deallocate(ptr, size, align);
+}
+
 // FIXME: #7496
 #[cfg(not(test))]
 #[lang="closure_exchange_malloc"]