diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2013-07-08 13:27:55 -0400 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2013-07-09 16:35:56 -0400 |
| commit | a4af0960bd4bef820cdd10b014d1f9858ec9fa14 (patch) | |
| tree | 0014510e3f79782b088445df50a685ee7de63534 | |
| parent | 5aa0ca9b2eb28166d9ab2e86557a5b1f84230b46 (diff) | |
| download | rust-a4af0960bd4bef820cdd10b014d1f9858ec9fa14.tar.gz rust-a4af0960bd4bef820cdd10b014d1f9858ec9fa14.zip | |
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
| -rw-r--r-- | src/librustc/middle/trans/base.rs | 3 | ||||
| -rw-r--r-- | 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 80fc3803ae7..2fc502568a8 100644 --- a/src/librustc/middle/trans/base.rs +++ b/src/librustc/middle/trans/base.rs @@ -292,13 +292,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 54deb8924f5..ef89b8de454 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 } |
