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
This commit is contained in:
Daniel Micay 2013-07-08 13:27:55 -04:00
parent ed69ef0b66
commit d3be8ab158
2 changed files with 3 additions and 4 deletions

View file

@ -291,13 +291,12 @@ pub fn malloc_raw_dyn(bcx: block,
if heap == heap_exchange { if heap == heap_exchange {
let llty_value = type_of::type_of(ccx, t); let llty_value = type_of::type_of(ccx, t);
let llalign = llalign_of_min(ccx, llty_value);
// Allocate space: // Allocate space:
let r = callee::trans_lang_call( let r = callee::trans_lang_call(
bcx, bcx,
bcx.tcx().lang_items.exchange_malloc_fn(), bcx.tcx().lang_items.exchange_malloc_fn(),
[C_i32(llalign as i32), size], [size],
None); None);
rslt(r.bcx, PointerCast(r.bcx, r.val, llty_value.ptr_to())) rslt(r.bcx, PointerCast(r.bcx, r.val, llty_value.ptr_to()))
} else if heap == heap_exchange_vector { } else if heap == heap_exchange_vector {

View file

@ -76,11 +76,11 @@ pub unsafe fn exchange_malloc(td: *c_char, size: uintptr_t) -> *c_char {
box as *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))] #[cfg(not(stage0), not(test))]
#[lang="exchange_malloc"] #[lang="exchange_malloc"]
#[inline] #[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 malloc_raw(size as uint) as *c_char
} }