Skip to content

Commit f3de28a

Browse files
committed
mark rust_malloc/rust_free as unsafe
Support for this was added by 08237ca.
1 parent 034f218 commit f3de28a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/libstd/rt/heap.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,26 +179,26 @@ unsafe fn closure_exchange_malloc(drop_glue: fn(*mut u8), size: uint, align: uin
179179
#[doc(hidden)]
180180
#[deprecated]
181181
#[cfg(stage0, not(test))]
182-
pub extern "C" fn rust_malloc(size: uint) -> *mut u8 {
183-
unsafe { exchange_malloc(size) }
182+
pub unsafe extern "C" fn rust_malloc(size: uint) -> *mut u8 {
183+
exchange_malloc(size)
184184
}
185185

186186
// hack for libcore
187187
#[no_mangle]
188188
#[doc(hidden)]
189189
#[deprecated]
190190
#[cfg(not(stage0), not(test))]
191-
pub extern "C" fn rust_malloc(size: uint, align: uint) -> *mut u8 {
192-
unsafe { exchange_malloc(size, align) }
191+
pub unsafe extern "C" fn rust_malloc(size: uint, align: uint) -> *mut u8 {
192+
exchange_malloc(size, align)
193193
}
194194

195195
// hack for libcore
196196
#[no_mangle]
197197
#[doc(hidden)]
198198
#[deprecated]
199199
#[cfg(not(test))]
200-
pub extern "C" fn rust_free(ptr: *mut u8, size: uint, align: uint) {
201-
unsafe { exchange_free(ptr, size, align) }
200+
pub unsafe extern "C" fn rust_free(ptr: *mut u8, size: uint, align: uint) {
201+
exchange_free(ptr, size, align)
202202
}
203203

204204
#[cfg(test)]

0 commit comments

Comments
 (0)