Skip to content

Commit 1c9514b

Browse files
committed
---
yaml --- r: 30206 b: refs/heads/incoming c: 0e1a4a4 h: refs/heads/master v: v3
1 parent 6885499 commit 1c9514b

File tree

4 files changed

+8
-26
lines changed

4 files changed

+8
-26
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: 536cb90a216a08870fbaac6aad93f77f0681537d
9+
refs/heads/incoming: 0e1a4a4da29caadba5d5cd86a5cd2587fdb0755d
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libcore/vec.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,6 @@ extern mod rustrt {
102102
fn vec_reserve_shared(++t: *sys::TypeDesc,
103103
++v: **unsafe::VecRepr,
104104
++n: libc::size_t);
105-
fn vec_from_buf_shared(++t: *sys::TypeDesc,
106-
++ptr: *(),
107-
++count: libc::size_t) -> *unsafe::VecRepr;
108105
}
109106

110107
#[abi = "rust-intrinsic"]
@@ -1727,10 +1724,11 @@ mod unsafe {
17271724
*/
17281725
#[inline(always)]
17291726
unsafe fn from_buf<T>(ptr: *T, elts: uint) -> ~[T] {
1730-
return ::unsafe::reinterpret_cast(
1731-
rustrt::vec_from_buf_shared(sys::get_type_desc::<T>(),
1732-
ptr as *(),
1733-
elts as size_t));
1727+
let mut dst = ~[];
1728+
reserve(dst, elts);
1729+
set_len(dst, elts);
1730+
as_buf(dst, |p_dst, _len_dst| ptr::memcpy(p_dst, ptr, elts));
1731+
dst
17341732
}
17351733

17361734
/**

branches/incoming/src/rt/rust_builtin.cpp

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -148,22 +148,6 @@ str_reserve_shared(rust_vec_box** sp,
148148
reserve_vec_exact(task, sp, n_elts + 1);
149149
}
150150

151-
/**
152-
* Copies elements in an unsafe buffer to the given interior vector. The
153-
* vector must have size zero.
154-
*/
155-
extern "C" CDECL rust_vec_box*
156-
vec_from_buf_shared(type_desc *ty, void *ptr, size_t count) {
157-
rust_task *task = rust_get_current_task();
158-
size_t fill = ty->size * count;
159-
rust_vec_box* v = (rust_vec_box*)
160-
task->kernel->malloc(fill + sizeof(rust_vec_box),
161-
"vec_from_buf");
162-
v->body.fill = v->body.alloc = fill;
163-
memmove(&v->body.data[0], ptr, fill);
164-
return v;
165-
}
166-
167151
extern "C" CDECL void
168152
rust_str_push(rust_vec_box** sp, uint8_t byte) {
169153
rust_task *task = rust_get_current_task();
@@ -515,8 +499,9 @@ void tm_to_rust_tm(tm* in_tm, rust_tm* out_tm, int32_t gmtoff,
515499
out_tm->tm_nsec = nsec;
516500

517501
if (zone != NULL) {
502+
rust_task *task = rust_get_current_task();
518503
size_t size = strlen(zone);
519-
str_reserve_shared(&out_tm->tm_zone, size);
504+
reserve_vec_exact(task, &out_tm->tm_zone, size + 1);
520505
memcpy(out_tm->tm_zone->body.data, zone, size);
521506
out_tm->tm_zone->body.fill = size + 1;
522507
out_tm->tm_zone->body.data[size] = '\0';

branches/incoming/src/rt/rustrt.def.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ start_task
6363
vec_reserve_shared_actual
6464
vec_reserve_shared
6565
str_reserve_shared
66-
vec_from_buf_shared
6766
task_clear_event_reject
6867
task_wait_event
6968
task_signal_event

0 commit comments

Comments
 (0)