Rename std::vec::unsafe::ivec_repr to vec_repr. Issue #855
This commit is contained in:
parent
72c14d5a41
commit
1e8200dadd
1 changed files with 5 additions and 5 deletions
|
|
@ -341,21 +341,21 @@ iter iter2<@T>(v: &[T]) -> (uint, T) {
|
|||
}
|
||||
|
||||
mod unsafe {
|
||||
type ivec_repr = {mutable fill: uint,
|
||||
mutable alloc: uint,
|
||||
data: u8};
|
||||
type vec_repr = {mutable fill: uint,
|
||||
mutable alloc: uint,
|
||||
data: u8};
|
||||
|
||||
fn from_buf<T>(ptr: *T, elts: uint) -> [T] {
|
||||
ret rustrt::vec_from_buf_shared(ptr, elts);
|
||||
}
|
||||
|
||||
fn set_len<T>(v: &mutable [T], new_len: uint) {
|
||||
let repr: **ivec_repr = ::unsafe::reinterpret_cast(addr_of(v));
|
||||
let repr: **vec_repr = ::unsafe::reinterpret_cast(addr_of(v));
|
||||
(**repr).fill = new_len * sys::size_of::<T>();
|
||||
}
|
||||
|
||||
fn to_ptr<T>(v: &[T]) -> *T {
|
||||
let repr: **ivec_repr = ::unsafe::reinterpret_cast(addr_of(v));
|
||||
let repr: **vec_repr = ::unsafe::reinterpret_cast(addr_of(v));
|
||||
ret ::unsafe::reinterpret_cast(addr_of((**repr).data));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue