about summary refs log tree commit diff
path: root/src/liballoc/heap.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-07-02 11:08:21 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-07-02 11:08:21 -0700
commitff1dd44b40a7243f43a8d32ba8bd6026197c320b (patch)
tree4460cbf0a917a289d1d3744d9645c5ab131ea9df /src/liballoc/heap.rs
parentaa1163b92de7717eb7c5eba002b4012e0574a7fe (diff)
parentca2778ede7c21efc3cf2e4e1152875ec09360770 (diff)
downloadrust-ff1dd44b40a7243f43a8d32ba8bd6026197c320b.tar.gz
rust-ff1dd44b40a7243f43a8d32ba8bd6026197c320b.zip
Merge remote-tracking branch 'origin/master' into 0.11.0-release
Conflicts:
	src/libstd/lib.rs
Diffstat (limited to 'src/liballoc/heap.rs')
-rw-r--r--src/liballoc/heap.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/liballoc/heap.rs b/src/liballoc/heap.rs
index b4d0057778a..dc8280e9b83 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<extern "C" fn(cbopaque: *mut c_void, *c_char)>,
+        fn je_malloc_stats_print(write_cb: Option<extern "C" fn(cbopaque: *mut c_void,
+                                                                *const c_char)>,
                                  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::<uint>() {
             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;
     }
@@ -328,7 +329,7 @@ mod bench {
     #[bench]
     fn alloc_owned_small(b: &mut Bencher) {
         b.iter(|| {
-            box 10
+            box 10i
         })
     }
 }