about summary refs log tree commit diff
path: root/src/rt/rust_builtin.cpp
diff options
context:
space:
mode:
authorRoy Frostig <rfrostig@mozilla.com>2010-07-22 17:47:32 -0700
committerRoy Frostig <rfrostig@mozilla.com>2010-07-22 17:47:32 -0700
commit1730d2e037fc41f31d0a90b2fde477f02f0fc798 (patch)
tree4e920841841b4cbf35862f3db41db7f688ffffa9 /src/rt/rust_builtin.cpp
parentede42cf931dc9cb7c7f4c78d7f9521985c2a8e11 (diff)
downloadrust-1730d2e037fc41f31d0a90b2fde477f02f0fc798.tar.gz
rust-1730d2e037fc41f31d0a90b2fde477f02f0fc798.zip
Notify copy glue of dst-initialization and fix _vec.alloc issues in lib and runtime. Closes #109.
Diffstat (limited to 'src/rt/rust_builtin.cpp')
-rw-r--r--src/rt/rust_builtin.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index 0b492de84a1..99fa953580c 100644
--- a/src/rt/rust_builtin.cpp
+++ b/src/rt/rust_builtin.cpp
@@ -92,15 +92,15 @@ unsupervise(rust_task *task) {
 }
 
 extern "C" CDECL rust_vec*
-vec_alloc(rust_task *task, type_desc *t, size_t n_elts)
+vec_alloc(rust_task *task, type_desc *t, type_desc *elem_t, size_t n_elts)
 {
     rust_dom *dom = task->dom;
     task->log(rust_log::MEM,
-            "vec_alloc %" PRIdPTR " elements of size %" PRIdPTR,
-             n_elts, t->size);
-    size_t fill = n_elts * t->size;
+              "vec_alloc %" PRIdPTR " elements of size %" PRIdPTR,
+              n_elts, elem_t->size);
+    size_t fill = n_elts * elem_t->size;
     size_t alloc = next_power_of_two(sizeof(rust_vec) + fill);
-    void *mem = dom->malloc(alloc);
+    void *mem = task->malloc(alloc, t->is_stateful ? t : NULL);
     if (!mem) {
         task->fail(3);
         return NULL;