diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2014-01-21 09:31:32 -0500 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2014-01-22 23:13:53 -0500 |
| commit | 802d41fe235794d84084897ae6187ee5cc27dd95 (patch) | |
| tree | 6cd1eecb0ec529673396040e2c43ad08941732e9 /src/libstd/rt | |
| parent | fce792249e72a181f2ad52413b25b1db643c371f (diff) | |
| download | rust-802d41fe235794d84084897ae6187ee5cc27dd95.tar.gz rust-802d41fe235794d84084897ae6187ee5cc27dd95.zip | |
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.
Diffstat (limited to 'src/libstd/rt')
| -rw-r--r-- | src/libstd/rt/global_heap.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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)] |
