From f3de28a920b9a9f2b9418b305dfeb30995d2c6d4 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sun, 11 May 2014 17:17:53 -0400 Subject: [PATCH] mark rust_malloc/rust_free as unsafe Support for this was added by 08237cad8d2ce9287aedf99e57384407cc9dc42d. --- src/libstd/rt/heap.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libstd/rt/heap.rs b/src/libstd/rt/heap.rs index ffe6dccfa15..fc62b3f12fb 100644 --- a/src/libstd/rt/heap.rs +++ b/src/libstd/rt/heap.rs @@ -179,8 +179,8 @@ unsafe fn closure_exchange_malloc(drop_glue: fn(*mut u8), size: uint, align: uin #[doc(hidden)] #[deprecated] #[cfg(stage0, not(test))] -pub extern "C" fn rust_malloc(size: uint) -> *mut u8 { - unsafe { exchange_malloc(size) } +pub unsafe extern "C" fn rust_malloc(size: uint) -> *mut u8 { + exchange_malloc(size) } // hack for libcore @@ -188,8 +188,8 @@ pub extern "C" fn rust_malloc(size: uint) -> *mut u8 { #[doc(hidden)] #[deprecated] #[cfg(not(stage0), not(test))] -pub extern "C" fn rust_malloc(size: uint, align: uint) -> *mut u8 { - unsafe { exchange_malloc(size, align) } +pub unsafe extern "C" fn rust_malloc(size: uint, align: uint) -> *mut u8 { + exchange_malloc(size, align) } // hack for libcore @@ -197,8 +197,8 @@ pub extern "C" fn rust_malloc(size: uint, align: uint) -> *mut u8 { #[doc(hidden)] #[deprecated] #[cfg(not(test))] -pub extern "C" fn rust_free(ptr: *mut u8, size: uint, align: uint) { - unsafe { exchange_free(ptr, size, align) } +pub unsafe extern "C" fn rust_free(ptr: *mut u8, size: uint, align: uint) { + exchange_free(ptr, size, align) } #[cfg(test)]