Skip to content

Commit 3ced349

Browse files
committed
---
yaml --- r: 23610 b: refs/heads/master c: 628b946 h: refs/heads/master v: v3
1 parent 018f70b commit 3ced349

File tree

4 files changed

+4
-16
lines changed

4 files changed

+4
-16
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 9074d9b5813c43cb1d4920dbc9de7dfde032577a
2+
refs/heads/master: 628b94618695fdf24b5b8cc9f56af6d86efa265d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/src/libcore/str.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,6 @@ export
115115
StrSlice,
116116
UniqueStr;
117117

118-
#[abi = "cdecl"]
119-
extern mod rustrt {
120-
fn str_reserve_shared(&ss: ~str, nn: libc::size_t);
121-
}
122-
123118
/*
124119
Section: Creating a string
125120
*/
@@ -1818,8 +1813,9 @@ pure fn as_buf<T>(s: &str, f: fn(*u8, uint) -> T) -> T {
18181813
* * n - The number of bytes to reserve space for
18191814
*/
18201815
fn reserve(&s: ~str, n: uint) {
1821-
if capacity(s) < n {
1822-
rustrt::str_reserve_shared(s, n as size_t);
1816+
unsafe {
1817+
let v: *mut ~[u8] = ::unsafe::reinterpret_cast(ptr::addr_of(s));
1818+
vec::reserve(*v, n + 1);
18231819
}
18241820
}
18251821

trunk/src/rt/rust_builtin.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,6 @@ vec_reserve_shared(type_desc* ty, rust_vec_box** vp,
141141
reserve_vec_exact(task, vp, n_elts * ty->size);
142142
}
143143

144-
extern "C" CDECL void
145-
str_reserve_shared(rust_vec_box** sp,
146-
size_t n_elts) {
147-
rust_task *task = rust_get_current_task();
148-
reserve_vec_exact(task, sp, n_elts + 1);
149-
}
150-
151144
extern "C" CDECL rust_vec*
152145
rand_seed() {
153146
size_t size = sizeof(ub4) * RANDSIZ;

trunk/src/rt/rustrt.def.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ shape_log_str
6161
start_task
6262
vec_reserve_shared_actual
6363
vec_reserve_shared
64-
str_reserve_shared
6564
task_clear_event_reject
6665
task_wait_event
6766
task_signal_event

0 commit comments

Comments
 (0)