Skip to content

Commit 7bf34c3

Browse files
committed
vec: make vec_reserve_shared_actual private
1 parent e07ae9e commit 7bf34c3

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

src/libstd/vec.rs

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,15 @@ use sys::size_of;
3333
use uint;
3434
use unstable::intrinsics;
3535
#[cfg(stage0)]
36-
use intrinsic::{get_tydesc};
36+
use intrinsic::{get_tydesc, TyDesc};
3737
#[cfg(not(stage0))]
38-
use unstable::intrinsics::{get_tydesc, contains_managed};
38+
use unstable::intrinsics::{get_tydesc, contains_managed, TyDesc};
3939
use vec;
4040
use util;
4141

42-
#[doc(hidden)]
43-
pub mod rustrt {
44-
use libc;
45-
use vec::raw;
46-
#[cfg(stage0)]
47-
use intrinsic::{TyDesc};
48-
#[cfg(not(stage0))]
49-
use unstable::intrinsics::{TyDesc};
50-
51-
#[abi = "cdecl"]
52-
pub extern {
53-
#[fast_ffi]
54-
unsafe fn vec_reserve_shared_actual(t: *TyDesc,
55-
v: **raw::VecRepr,
56-
n: libc::size_t);
57-
}
42+
extern {
43+
#[fast_ffi]
44+
unsafe fn vec_reserve_shared_actual(t: *TyDesc, v: **raw::VecRepr, n: libc::size_t);
5845
}
5946

6047
/// Returns true if two vectors have the same length
@@ -1152,7 +1139,7 @@ impl<T> OwnedVector<T> for ~[T] {
11521139
let td = get_tydesc::<T>();
11531140
if ((**ptr).box_header.ref_count ==
11541141
managed::raw::RC_MANAGED_UNIQUE) {
1155-
rustrt::vec_reserve_shared_actual(td, ptr as **raw::VecRepr, n as libc::size_t);
1142+
vec_reserve_shared_actual(td, ptr as **raw::VecRepr, n as libc::size_t);
11561143
} else {
11571144
let alloc = n * sys::nonzero_size_of::<T>();
11581145
*ptr = realloc_raw(*ptr as *mut c_void, alloc + size_of::<raw::VecRepr>())
@@ -1182,7 +1169,7 @@ impl<T> OwnedVector<T> for ~[T] {
11821169
let ptr: *mut *mut raw::VecRepr = cast::transmute(self);
11831170
let td = get_tydesc::<T>();
11841171
if contains_managed::<T>() {
1185-
rustrt::vec_reserve_shared_actual(td, ptr as **raw::VecRepr, n as libc::size_t);
1172+
vec_reserve_shared_actual(td, ptr as **raw::VecRepr, n as libc::size_t);
11861173
} else {
11871174
let alloc = n * sys::nonzero_size_of::<T>();
11881175
*ptr = realloc_raw(*ptr as *mut c_void, alloc + size_of::<raw::VecRepr>())

0 commit comments

Comments
 (0)