Machine types are different from int/uint, etc (Issue #2187)

This commit is contained in:
Eric Holk
2012-06-04 17:26:17 -07:00
parent 5f904d278f
commit 1e8f501343
24 changed files with 200 additions and 131 deletions

View File

@@ -2,6 +2,7 @@
import option::{some, none};
import ptr::addr_of;
import libc::size_t;
export init_op;
export is_empty;
@@ -123,7 +124,8 @@ fn reserve<T>(&v: [const T], n: uint) {
// Only make the (slow) call into the runtime if we have to
if capacity(v) < n {
let ptr = ptr::addr_of(v) as **unsafe::vec_repr;
rustrt::vec_reserve_shared(sys::get_type_desc::<T>(), ptr, n);
rustrt::vec_reserve_shared(sys::get_type_desc::<T>(),
ptr, n as size_t);
}
}
@@ -1213,7 +1215,7 @@ mod unsafe {
ret ::unsafe::reinterpret_cast(
rustrt::vec_from_buf_shared(sys::get_type_desc::<T>(),
ptr as *(),
elts));
elts as size_t));
}
#[doc = "