From 69b321c84bea60b2ac727c4acbd9a34b19182209 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sun, 11 May 2014 18:41:01 -0400 Subject: 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. --- src/libsync/arc.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/libsync') 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 Drop for Arc { if self.inner().weak.fetch_sub(1, atomics::Release) == 1 { atomics::fence(atomics::Acquire); - unsafe { exchange_free(self.x as *mut u8, size_of::>(), - min_align_of::>()) } + unsafe { deallocate(self.x as *mut u8, size_of::>(), + min_align_of::>()) } } } } @@ -242,8 +242,8 @@ impl Drop for Weak { // 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::>(), - min_align_of::>()) } + unsafe { deallocate(self.x as *mut u8, size_of::>(), + min_align_of::>()) } } } } -- cgit 1.4.1-3-g733a5