about summary refs log tree commit diff
path: root/src/rt/rust_builtin.cpp
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-05-22 18:42:30 -0700
committerBrian Anderson <banderson@mozilla.com>2012-05-30 21:23:34 -0700
commit3f8223ffc2b820108677ca9c69e3db98af1b157d (patch)
tree9a73271faca1affdb027d787ca04242f51aafc29 /src/rt/rust_builtin.cpp
parentecd431809431b07fd63fb62c0f3ae70e2c917582 (diff)
downloadrust-3f8223ffc2b820108677ca9c69e3db98af1b157d.tar.gz
rust-3f8223ffc2b820108677ca9c69e3db98af1b157d.zip
rt: Fix vec_from_buf_shared for new vecs
Diffstat (limited to 'src/rt/rust_builtin.cpp')
-rw-r--r--src/rt/rust_builtin.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index 7b00c6e701c..4f512390210 100644
--- a/src/rt/rust_builtin.cpp
+++ b/src/rt/rust_builtin.cpp
@@ -157,14 +157,15 @@ str_reserve_shared(rust_vec_box** sp,
  * Copies elements in an unsafe buffer to the given interior vector. The
  * vector must have size zero.
  */
-extern "C" CDECL rust_vec*
+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* v = (rust_vec*)task->kernel->malloc(fill + sizeof(rust_vec),
-                                                    "vec_from_buf");
-    v->fill = v->alloc = fill;
-    memmove(&v->data[0], ptr, fill);
+    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;
 }