summary refs log tree commit diff
path: root/src/rt/rust_task.cpp
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2012-01-06 12:06:35 -0800
committerNiko Matsakis <niko@alum.mit.edu>2012-01-06 22:40:31 -0800
commit8506241f3a0dce3f0d24764a3ce3d16f99bcb809 (patch)
tree70d453fea82f951f06184de75d45f2ada8536e4b /src/rt/rust_task.cpp
parent8e89df69de47a4f944f5c3fc249a88c5934864b2 (diff)
downloadrust-8506241f3a0dce3f0d24764a3ce3d16f99bcb809.tar.gz
rust-8506241f3a0dce3f0d24764a3ce3d16f99bcb809.zip
fix how we walk functions to match new closure fmt
Diffstat (limited to 'src/rt/rust_task.cpp')
-rw-r--r--src/rt/rust_task.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index cade11e372d..79a6abdcf39 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -293,7 +293,7 @@ rust_task::~rust_task()
 struct spawn_args {
     rust_task *task;
     spawn_fn f;
-    rust_boxed_closure *envptr;
+    rust_opaque_closure *envptr;
     void *argptr;
 };
 
@@ -347,12 +347,13 @@ void task_start_wrapper(spawn_args *a)
         failed = true;
     }
 
-    rust_boxed_closure* boxed_env = (rust_boxed_closure*)a->envptr;
-    if(boxed_env) {
+    rust_opaque_closure* env = a->envptr;
+    if(env) {
         // free the environment.
-        const type_desc *td = boxed_env->closure.td;
-        td->drop_glue(NULL, NULL, td->first_param, &boxed_env->closure);
-        upcall_shared_free(boxed_env);
+        const type_desc *td = env->td;
+        LOG(task, task, "Freeing env %p with td %p", env, td);
+        td->drop_glue(NULL, NULL, td->first_param, env);
+        upcall_shared_free(env);
     }
 
     // The cleanup work needs lots of stack
@@ -364,7 +365,7 @@ void task_start_wrapper(spawn_args *a)
 
 void
 rust_task::start(spawn_fn spawnee_fn,
-                 rust_boxed_closure *envptr,
+                 rust_opaque_closure *envptr,
                  void *argptr)
 {
     LOG(this, task, "starting task from fn 0x%" PRIxPTR