Skip to content

Commit

Permalink
mark rust_malloc/rust_free as unsafe
Browse files Browse the repository at this point in the history
Support for this was added by 08237ca.
  • Loading branch information
thestinger committed May 11, 2014
1 parent 034f218 commit f3de28a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/libstd/rt/heap.rs
Expand Up @@ -179,26 +179,26 @@ 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
#[no_mangle]
#[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
#[no_mangle]
#[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)]
Expand Down

0 comments on commit f3de28a

Please sign in to comment.