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/libstd/rt | |
| 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/libstd/rt')
| -rw-r--r-- | src/libstd/rt/heap.rs | 11 |
1 files changed, 3 insertions, 8 deletions
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)] |
