Skip to content

Commit d21bfbf

Browse files
committed
---
yaml --- r: 32272 b: refs/heads/dist-snap c: 628b946 h: refs/heads/master v: v3
1 parent 2a8cc86 commit d21bfbf

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
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: 9074d9b5813c43cb1d4920dbc9de7dfde032577a
10+
refs/heads/dist-snap: 628b94618695fdf24b5b8cc9f56af6d86efa265d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/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

branches/dist-snap/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;

branches/dist-snap/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)