about summary refs log tree commit diff
path: root/src/rt/rust_upcall.cpp
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2010-09-29 17:22:07 -0700
committerGraydon Hoare <graydon@mozilla.com>2010-09-29 17:22:13 -0700
commitb970563fe3f36853250f4cef65a8425431789e8b (patch)
treec09d7d39a46419c24ea88164ee047c10ebd7da39 /src/rt/rust_upcall.cpp
parent7e733bf2ee0c23be5a49fd81a419d3e69c38be27 (diff)
downloadrust-b970563fe3f36853250f4cef65a8425431789e8b.tar.gz
rust-b970563fe3f36853250f4cef65a8425431789e8b.zip
Patchwork of attempted fixes to effect system and gc system; eventually give up and disable it entirely in the runtime. Will need extensive reworking.
Diffstat (limited to 'src/rt/rust_upcall.cpp')
-rw-r--r--src/rt/rust_upcall.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp
index 9a5e73f8daa..9742b22af78 100644
--- a/src/rt/rust_upcall.cpp
+++ b/src/rt/rust_upcall.cpp
@@ -312,8 +312,8 @@ upcall_free(rust_task *task, void* ptr, uintptr_t is_gc) {
     LOG_UPCALL_ENTRY(task);
     rust_dom *dom = task->dom;
     dom->log(rust_log::UPCALL|rust_log::MEM,
-             "upcall free(0x%" PRIxPTR ")",
-             (uintptr_t)ptr);
+             "upcall free(0x%" PRIxPTR ", is_gc=%" PRIdPTR ")",
+             (uintptr_t)ptr, is_gc);
     task->free(ptr, (bool) is_gc);
 }
 
@@ -338,7 +338,7 @@ upcall_new_str(rust_task *task, char const *s, size_t fill) {
     LOG_UPCALL_ENTRY(task);
     rust_dom *dom = task->dom;
     size_t alloc = next_power_of_two(sizeof(rust_str) + fill);
-    void *mem = dom->malloc(alloc);
+    void *mem = task->malloc(alloc);
     if (!mem) {
         task->fail(3);
         return NULL;
@@ -373,7 +373,8 @@ extern "C" CDECL rust_vec *
 upcall_vec_grow(rust_task *task,
                 rust_vec *v,
                 size_t n_bytes,
-                uintptr_t *need_copy)
+                uintptr_t *need_copy,
+                type_desc *td)
 {
     LOG_UPCALL_ENTRY(task);
     rust_dom *dom = task->dom;
@@ -396,7 +397,7 @@ upcall_vec_grow(rust_task *task,
 
         // Second-fastest path: can at least realloc.
         task->log(rust_log::UPCALL | rust_log::MEM, "realloc path");
-        v = (rust_vec*) dom->realloc(v, alloc);
+        v = (rust_vec*) task->realloc(v, alloc, td->is_stateful);
         if (!v) {
             task->fail(4);
             return NULL;
@@ -418,7 +419,7 @@ upcall_vec_grow(rust_task *task,
          * that we need the copies performed for us.
          */
         task->log(rust_log::UPCALL | rust_log::MEM, "new vec path");
-        void *mem = dom->malloc(alloc);
+        void *mem = task->malloc(alloc, td);
         if (!mem) {
             task->fail(4);
             return NULL;