From 8506241f3a0dce3f0d24764a3ce3d16f99bcb809 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Fri, 6 Jan 2012 12:06:35 -0800 Subject: fix how we walk functions to match new closure fmt --- src/rt/rust_task.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/rt/rust_task.cpp') 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 -- cgit 1.4.1-3-g733a5