about summary refs log tree commit diff
path: root/src/liballoc/heap.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-05-22 15:16:31 -0700
committerbors <bors@rust-lang.org>2014-05-22 15:16:31 -0700
commit87ad19eb78239707f1ceed43e475c6aa052efdbc (patch)
tree35940d52f145bca81dcf73e5e7da7f3847ceb413 /src/liballoc/heap.rs
parente402e75f4eb79af09b9451f0f232f994b3e2c998 (diff)
parente878721d70349e2055f0ef854085de92e9498fde (diff)
downloadrust-87ad19eb78239707f1ceed43e475c6aa052efdbc.tar.gz
rust-87ad19eb78239707f1ceed43e475c6aa052efdbc.zip
auto merge of #14310 : pcwalton/rust/detildestr-alllibs, r=brson
r? @brson
Diffstat (limited to 'src/liballoc/heap.rs')
-rw-r--r--src/liballoc/heap.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/liballoc/heap.rs b/src/liballoc/heap.rs
index 631b72cb897..8376fc578db 100644
--- a/src/liballoc/heap.rs
+++ b/src/liballoc/heap.rs
@@ -116,18 +116,18 @@ pub fn stats_print() {
     }
 }
 
+// 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.
+pub static mut EMPTY: uint = 12345;
+
 /// The allocator for unique pointers.
 #[cfg(not(test))]
 #[lang="exchange_malloc"]
 #[inline]
 unsafe fn exchange_malloc(size: uint, align: 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
+        &EMPTY as *uint as *mut u8
     } else {
         allocate(size, align)
     }