From 802d41fe235794d84084897ae6187ee5cc27dd95 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Tue, 21 Jan 2014 09:31:32 -0500 Subject: libc: switch `free` to the proper signature This does not attempt to fully propagate the mutability everywhere, but gives new code a hint to avoid the same issues. --- src/libstd/rt/global_heap.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libstd/rt') diff --git a/src/libstd/rt/global_heap.rs b/src/libstd/rt/global_heap.rs index 54442cedb68..ead78ce41ef 100644 --- a/src/libstd/rt/global_heap.rs +++ b/src/libstd/rt/global_heap.rs @@ -52,7 +52,7 @@ pub unsafe fn realloc_raw(ptr: *mut u8, size: uint) -> *mut u8 { // `realloc(ptr, 0)` may allocate, but it may also return a null pointer // http://pubs.opengroup.org/onlinepubs/9699919799/functions/realloc.html if size == 0 { - free(ptr as *c_void); + free(ptr); mut_null() } else { let p = realloc(ptr as *mut c_void, size as size_t); @@ -107,7 +107,7 @@ pub unsafe fn exchange_free_(ptr: *u8) { #[inline] pub unsafe fn exchange_free(ptr: *u8) { - free(ptr as *c_void); + free(ptr as *mut c_void); } #[cfg(test)] -- cgit 1.4.1-3-g733a5