diff options
Diffstat (limited to 'src/libstd/rt')
| -rw-r--r-- | src/libstd/rt/global_heap.rs | 15 | ||||
| -rw-r--r-- | src/libstd/rt/uv/mod.rs | 3 |
2 files changed, 7 insertions, 11 deletions
diff --git a/src/libstd/rt/global_heap.rs b/src/libstd/rt/global_heap.rs index 4b475d74397..c9bf3b28530 100644 --- a/src/libstd/rt/global_heap.rs +++ b/src/libstd/rt/global_heap.rs @@ -60,12 +60,6 @@ pub unsafe fn realloc_raw(ptr: *mut c_void, size: uint) -> *mut c_void { #[cfg(stage0, not(test))] #[lang="exchange_malloc"] #[inline] -pub unsafe fn exchange_malloc_(td: *c_char, size: uintptr_t) -> *c_char { - exchange_malloc(td, size) -} - -#[cfg(stage0)] -#[inline] pub unsafe fn exchange_malloc(td: *c_char, size: uintptr_t) -> *c_char { let td = td as *TyDesc; let size = size as uint; @@ -86,13 +80,14 @@ pub unsafe fn exchange_malloc(td: *c_char, size: uintptr_t) -> *c_char { #[cfg(not(stage0), not(test))] #[lang="exchange_malloc"] #[inline] -pub unsafe fn exchange_malloc_(align: u32, size: uintptr_t) -> *c_char { - exchange_malloc(align, size) +pub unsafe fn exchange_malloc(align: u32, size: uintptr_t) -> *c_char { + malloc_raw(size as uint) as *c_char } -#[cfg(not(stage0))] +#[cfg(not(test))] +#[lang="vector_exchange_malloc"] #[inline] -pub unsafe fn exchange_malloc(align: u32, size: uintptr_t) -> *c_char { +pub unsafe fn vector_exchange_malloc(align: u32, size: uintptr_t) -> *c_char { let total_size = get_box_size(size as uint, align as uint); malloc_raw(total_size as uint) as *c_char } diff --git a/src/libstd/rt/uv/mod.rs b/src/libstd/rt/uv/mod.rs index e39a6384bc6..0eaf0dd3ab6 100644 --- a/src/libstd/rt/uv/mod.rs +++ b/src/libstd/rt/uv/mod.rs @@ -40,6 +40,7 @@ use str::raw::from_c_str; use to_str::ToStr; use ptr::RawPtr; use vec; +use vec::ImmutableVector; use ptr; use str; use libc::{c_void, c_int, size_t, malloc, free}; @@ -312,7 +313,7 @@ pub fn vec_to_uv_buf(v: ~[u8]) -> Buf { unsafe { let data = malloc(v.len() as size_t) as *u8; assert!(data.is_not_null()); - do vec::as_imm_buf(v) |b, l| { + do v.as_imm_buf |b, l| { let data = data as *mut u8; ptr::copy_memory(data, b, l) } |
