about summary refs log tree commit diff
path: root/src/libcore/unstable/exchange_alloc.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcore/unstable/exchange_alloc.rs')
-rw-r--r--src/libcore/unstable/exchange_alloc.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libcore/unstable/exchange_alloc.rs b/src/libcore/unstable/exchange_alloc.rs
index f59037445eb..a2815cebc51 100644
--- a/src/libcore/unstable/exchange_alloc.rs
+++ b/src/libcore/unstable/exchange_alloc.rs
@@ -20,11 +20,11 @@ use intrinsic::TyDesc;
 
 pub unsafe fn malloc(td: *TypeDesc, size: uint) -> *c_void {
     unsafe {
-        assert td.is_not_null();
+        fail_unless!(td.is_not_null());
 
         let total_size = get_box_size(size, (*td).align);
         let p = c_malloc(total_size as size_t);
-        assert p.is_not_null();
+        fail_unless!(p.is_not_null());
 
         // FIXME #3475: Converting between our two different tydesc types
         let td: *TyDesc = transmute(td);
@@ -46,7 +46,7 @@ pub unsafe fn free(ptr: *c_void) {
     let exchange_count = &mut *rust_get_exchange_count_ptr();
     atomic_xsub(exchange_count, 1);
 
-    assert ptr.is_not_null();
+    fail_unless!(ptr.is_not_null());
     c_free(ptr);
 }
 
@@ -60,7 +60,7 @@ fn get_box_size(body_size: uint, body_align: uint) -> uint {
 // Rounds |size| to the nearest |alignment|. Invariant: |alignment| is a power
 // of two.
 fn align_to(size: uint, align: uint) -> uint {
-    assert align != 0;
+    fail_unless!(align != 0);
     (size + align - 1) & !(align - 1)
 }