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/libstd/rt/heap.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/libstd/rt') diff --git a/src/libstd/rt/heap.rs b/src/libstd/rt/heap.rs index b56ba75e385..b729fb38035 100644 --- a/src/libstd/rt/heap.rs +++ b/src/libstd/rt/heap.rs @@ -165,13 +165,8 @@ pub unsafe fn exchange_malloc(size: uint, align: uint) -> *mut u8 { #[lang="exchange_free"] #[inline] // FIXME: #13994 (rustc should pass align and size here) -pub unsafe fn exchange_free_(ptr: *mut u8) { - exchange_free(ptr, 0, 8) -} - -#[inline] -pub unsafe fn exchange_free(ptr: *mut u8, size: uint, align: uint) { - deallocate(ptr, size, align); +unsafe fn exchange_free(ptr: *mut u8) { + deallocate(ptr, 0, 8); } // FIXME: #7496 @@ -212,7 +207,7 @@ pub unsafe extern "C" fn rust_malloc(size: uint, align: uint) -> *mut u8 { #[deprecated] #[cfg(not(test))] pub unsafe extern "C" fn rust_free(ptr: *mut u8, size: uint, align: uint) { - exchange_free(ptr, size, align) + deallocate(ptr, size, align) } #[cfg(test)] -- cgit 1.4.1-3-g733a5