Skip to content

Commit f57fd8d

Browse files
committed
rt: Run the cycle collector on the C stack
1 parent 74d5faa commit f57fd8d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/rt/rust_task.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,9 @@ void task_start_wrapper(spawn_args *a)
284284
failed = true;
285285
}
286286

287-
cc::do_cc(task);
287+
// We're on the Rust stack and the cycle collector may recurse arbitrarily
288+
// deep, so switch to the C stack
289+
task->sched->c_context.call_shim_on_c_stack(task, (void*)cc::do_cc);
288290

289291
rust_closure_env* env = (rust_closure_env*)a->a3;
290292
if(env) {

0 commit comments

Comments
 (0)