]> git.lizzy.rs Git - rust.git/commitdiff
rt: Run the cycle collector on the C stack
authorBrian Anderson <banderson@mozilla.com>
Sun, 18 Dec 2011 23:21:16 +0000 (15:21 -0800)
committerBrian Anderson <banderson@mozilla.com>
Sun, 18 Dec 2011 23:23:44 +0000 (15:23 -0800)
src/rt/rust_task.cpp

index 1a1a26fe73dfa8cf1262eda532838ae124641104..f74f821819c01f366c7aa391708c112c596a2a80 100644 (file)
@@ -284,7 +284,9 @@ void task_start_wrapper(spawn_args *a)
         failed = true;
     }
 
-    cc::do_cc(task);
+    // We're on the Rust stack and the cycle collector may recurse arbitrarily
+    // deep, so switch to the C stack
+    task->sched->c_context.call_shim_on_c_stack(task, (void*)cc::do_cc);
 
     rust_closure_env* env = (rust_closure_env*)a->a3;
     if(env) {