summary refs log tree commit diff
path: root/src/rt
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-08-31 16:14:18 -0700
committerBrian Anderson <banderson@mozilla.com>2012-08-31 16:14:18 -0700
commita0de6b6d5f2ed9ba26468f446d9030c8f87b03fc (patch)
tree89e2a84e824e9e19dbd009977296d6811499949f /src/rt
parent6d8d258f35321ed257d76d5e3c6458eed00ba574 (diff)
parent5c6be13b29c44920a39b9b9e95931f734b60d92b (diff)
downloadrust-a0de6b6d5f2ed9ba26468f446d9030c8f87b03fc.tar.gz
rust-a0de6b6d5f2ed9ba26468f446d9030c8f87b03fc.zip
Merge remote-tracking branch 'erickt/incoming'
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/rust_builtin.cpp36
-rw-r--r--src/rt/rustrt.def.in3
2 files changed, 2 insertions, 37 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index e4a34e06b24..e1fbabda50f 100644
--- a/src/rt/rust_builtin.cpp
+++ b/src/rt/rust_builtin.cpp
@@ -142,39 +142,6 @@ vec_reserve_shared(type_desc* ty, rust_vec_box** vp,
     reserve_vec_exact(task, vp, n_elts * ty->size);
 }
 
-extern "C" CDECL void
-str_reserve_shared(rust_vec_box** sp,
-                   size_t n_elts) {
-    rust_task *task = rust_get_current_task();
-    reserve_vec_exact(task, sp, n_elts + 1);
-}
-
-/**
- * Copies elements in an unsafe buffer to the given interior vector. The
- * vector must have size zero.
- */
-extern "C" CDECL rust_vec_box*
-vec_from_buf_shared(type_desc *ty, void *ptr, size_t count) {
-    rust_task *task = rust_get_current_task();
-    size_t fill = ty->size * count;
-    rust_vec_box* v = (rust_vec_box*)
-        task->kernel->malloc(fill + sizeof(rust_vec_box),
-                             "vec_from_buf");
-    v->body.fill = v->body.alloc = fill;
-    memmove(&v->body.data[0], ptr, fill);
-    return v;
-}
-
-extern "C" CDECL void
-rust_str_push(rust_vec_box** sp, uint8_t byte) {
-    rust_task *task = rust_get_current_task();
-    size_t fill = (*sp)->body.fill;
-    reserve_vec(task, sp, fill + 1);
-    (*sp)->body.data[fill-1] = byte;
-    (*sp)->body.data[fill] = 0;
-    (*sp)->body.fill = fill + 1;
-}
-
 extern "C" CDECL rust_vec*
 rand_seed() {
     size_t size = sizeof(ub4) * RANDSIZ;
@@ -516,8 +483,9 @@ void tm_to_rust_tm(tm* in_tm, rust_tm* out_tm, int32_t gmtoff,
     out_tm->tm_nsec = nsec;
 
     if (zone != NULL) {
+        rust_task *task = rust_get_current_task();
         size_t size = strlen(zone);
-        str_reserve_shared(&out_tm->tm_zone, size);
+        reserve_vec_exact(task, &out_tm->tm_zone, size + 1);
         memcpy(out_tm->tm_zone->body.data, zone, size);
         out_tm->tm_zone->body.fill = size + 1;
         out_tm->tm_zone->body.data[size] = '\0';
diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in
index b4db45ab3a0..8c550833d1c 100644
--- a/src/rt/rustrt.def.in
+++ b/src/rt/rustrt.def.in
@@ -38,7 +38,6 @@ rust_getcwd
 rust_get_stdin
 rust_get_stdout
 rust_get_stderr
-rust_str_push
 rust_list_files
 rust_log_console_on
 rust_log_console_off
@@ -62,8 +61,6 @@ shape_log_str
 start_task
 vec_reserve_shared_actual
 vec_reserve_shared
-str_reserve_shared
-vec_from_buf_shared
 task_clear_event_reject
 task_wait_event
 task_signal_event