From 0dfc90ab15475aa64bea393671463a8e9784ae3f Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 25 Jun 2014 12:47:34 -0700 Subject: Rename all raw pointers as necessary --- src/liballoc/heap.rs | 11 ++++++----- src/liballoc/owned.rs | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/liballoc') diff --git a/src/liballoc/heap.rs b/src/liballoc/heap.rs index b4d0057778a..589ff8c1de9 100644 --- a/src/liballoc/heap.rs +++ b/src/liballoc/heap.rs @@ -99,7 +99,7 @@ pub static mut EMPTY: uint = 12345; #[inline] unsafe fn exchange_malloc(size: uint, align: uint) -> *mut u8 { if size == 0 { - &EMPTY as *uint as *mut u8 + &EMPTY as *const uint as *mut u8 } else { allocate(size, align) } @@ -144,9 +144,10 @@ mod imp { flags: c_int) -> size_t; fn je_dallocx(ptr: *mut c_void, flags: c_int); fn je_nallocx(size: size_t, flags: c_int) -> size_t; - fn je_malloc_stats_print(write_cb: Option, + fn je_malloc_stats_print(write_cb: Option, cbopaque: *mut c_void, - opts: *c_char); + opts: *const c_char); } // -lpthread needs to occur after -ljemalloc, the earlier argument isn't enough @@ -226,7 +227,7 @@ mod imp { // a block of memory, so we special case everything under `*uint` to // just pass it to malloc, which is guaranteed to align to at least the // size of `*uint`. - if align < mem::size_of::<*uint>() { + if align < mem::size_of::() { libc_heap::malloc_raw(size) } else { let mut out = 0 as *mut libc::c_void; @@ -244,7 +245,7 @@ mod imp { pub unsafe fn reallocate(ptr: *mut u8, size: uint, align: uint, old_size: uint) -> *mut u8 { let new_ptr = allocate(size, align); - ptr::copy_memory(new_ptr, ptr as *u8, old_size); + ptr::copy_memory(new_ptr, ptr as *const u8, old_size); deallocate(ptr, old_size, align); return new_ptr; } diff --git a/src/liballoc/owned.rs b/src/liballoc/owned.rs index 6f5d3293556..05121903f5f 100644 --- a/src/liballoc/owned.rs +++ b/src/liballoc/owned.rs @@ -36,7 +36,7 @@ pub static HEAP: () = (); /// A type that represents a uniquely-owned value. #[lang="owned_box"] -pub struct Box(*T); +pub struct Box(*mut T); impl Default for Box { fn default() -> Box { box Default::default() } -- cgit 1.4.1-3-g733a5