diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2014-05-11 18:41:01 -0400 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2014-05-11 18:41:45 -0400 |
| commit | 69b321c84bea60b2ac727c4acbd9a34b19182209 (patch) | |
| tree | d3c82e585f6dab49fb155ee782c26e8be742bb8f /src/libsync | |
| parent | 32988db2bd82edc92f54c2d32fdcbd748ab78cd4 (diff) | |
| download | rust-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/libsync')
| -rw-r--r-- | src/libsync/arc.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libsync/arc.rs b/src/libsync/arc.rs index 4dc965d5d84..26d7e04fe1d 100644 --- a/src/libsync/arc.rs +++ b/src/libsync/arc.rs @@ -15,7 +15,7 @@ use std::mem; use std::ptr; -use std::rt::heap::exchange_free; +use std::rt::heap::deallocate; use std::sync::atomics; use std::mem::{min_align_of, size_of}; @@ -191,8 +191,8 @@ impl<T: Share + Send> Drop for Arc<T> { if self.inner().weak.fetch_sub(1, atomics::Release) == 1 { atomics::fence(atomics::Acquire); - unsafe { exchange_free(self.x as *mut u8, size_of::<ArcInner<T>>(), - min_align_of::<ArcInner<T>>()) } + unsafe { deallocate(self.x as *mut u8, size_of::<ArcInner<T>>(), + min_align_of::<ArcInner<T>>()) } } } } @@ -242,8 +242,8 @@ impl<T: Share + Send> Drop for Weak<T> { // the memory orderings if self.inner().weak.fetch_sub(1, atomics::Release) == 1 { atomics::fence(atomics::Acquire); - unsafe { exchange_free(self.x as *mut u8, size_of::<ArcInner<T>>(), - min_align_of::<ArcInner<T>>()) } + unsafe { deallocate(self.x as *mut u8, size_of::<ArcInner<T>>(), + min_align_of::<ArcInner<T>>()) } } } } |
