From d3be8ab158224da184939d163122fc685fabec15 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Mon, 8 Jul 2013 13:27:55 -0400 Subject: [PATCH] remove the unused exchange_malloc `align` parameter `malloc` already returns memory correctly aligned for every possible type in standard C, and that's enough for all types in Rust too --- src/librustc/middle/trans/base.rs | 3 +-- src/libstd/rt/global_heap.rs | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs index 577f1c6896067..ce9907acc092e 100644 --- a/src/librustc/middle/trans/base.rs +++ b/src/librustc/middle/trans/base.rs @@ -291,13 +291,12 @@ pub fn malloc_raw_dyn(bcx: block, if heap == heap_exchange { let llty_value = type_of::type_of(ccx, t); - let llalign = llalign_of_min(ccx, llty_value); // Allocate space: let r = callee::trans_lang_call( bcx, bcx.tcx().lang_items.exchange_malloc_fn(), - [C_i32(llalign as i32), size], + [size], None); rslt(r.bcx, PointerCast(r.bcx, r.val, llty_value.ptr_to())) } else if heap == heap_exchange_vector { diff --git a/src/libstd/rt/global_heap.rs b/src/libstd/rt/global_heap.rs index 54deb8924f5c7..ef89b8de45490 100644 --- a/src/libstd/rt/global_heap.rs +++ b/src/libstd/rt/global_heap.rs @@ -76,11 +76,11 @@ pub unsafe fn exchange_malloc(td: *c_char, size: uintptr_t) -> *c_char { box as *c_char } -// FIXME #4942: Make these signatures agree with exchange_alloc's signatures +/// The allocator for unique pointers without contained managed pointers. #[cfg(not(stage0), not(test))] #[lang="exchange_malloc"] #[inline] -pub unsafe fn exchange_malloc(_align: u32, size: uintptr_t) -> *c_char { +pub unsafe fn exchange_malloc(size: uintptr_t) -> *c_char { malloc_raw(size as uint) as *c_char }