about summary refs log tree commit diff
path: root/src/libstd/rc.rs
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2014-05-11 18:41:01 -0400
committerDaniel Micay <danielmicay@gmail.com>2014-05-11 18:41:45 -0400
commit69b321c84bea60b2ac727c4acbd9a34b19182209 (patch)
treed3c82e585f6dab49fb155ee782c26e8be742bb8f /src/libstd/rc.rs
parent32988db2bd82edc92f54c2d32fdcbd748ab78cd4 (diff)
downloadrust-69b321c84bea60b2ac727c4acbd9a34b19182209.tar.gz
rust-69b321c84bea60b2ac727c4acbd9a34b19182209.zip
heap: replace `exchange_free` with `deallocate`
The `std::rt::heap` API is Rust's global allocator, so there's no need
to have this as a separate API.
Diffstat (limited to 'src/libstd/rc.rs')
-rw-r--r--src/libstd/rc.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/rc.rs b/src/libstd/rc.rs
index bc489bc399f..87c2f826af5 100644
--- a/src/libstd/rc.rs
+++ b/src/libstd/rc.rs
@@ -33,7 +33,7 @@ use option::{Option, Some, None};
 use ptr;
 use ptr::RawPtr;
 use mem::{min_align_of, size_of};
-use rt::heap::exchange_free;
+use rt::heap::deallocate;
 
 struct RcBox<T> {
     value: T,
@@ -105,8 +105,8 @@ impl<T> Drop for Rc<T> {
                     self.dec_weak();
 
                     if self.weak() == 0 {
-                        exchange_free(self.ptr as *mut u8, size_of::<RcBox<T>>(),
-                                      min_align_of::<RcBox<T>>())
+                        deallocate(self.ptr as *mut u8, size_of::<RcBox<T>>(),
+                                   min_align_of::<RcBox<T>>())
                     }
                 }
             }
@@ -179,8 +179,8 @@ impl<T> Drop for Weak<T> {
                 // the weak count starts at 1, and will only go to
                 // zero if all the strong pointers have disappeared.
                 if self.weak() == 0 {
-                    exchange_free(self.ptr as *mut u8, size_of::<RcBox<T>>(),
-                                  min_align_of::<RcBox<T>>())
+                    deallocate(self.ptr as *mut u8, size_of::<RcBox<T>>(),
+                               min_align_of::<RcBox<T>>())
                 }
             }
         }