julia
c037c718 - gc: Free pooled stacks of exited threads on every sweep (#64036)

Commit
6 days ago
gc: Free pooled stacks of exited threads on every sweep (#64036) When a thread has exited (e.g. a foreign thread adopted with `jl_adopt_thread`), its pooled task stacks were only unmapped by the sweep whose rotating `gc_stack_free_idx` happened to point at it. Every other sweep called `small_arraylist_free` on its first stack pool, which drops the list without unmapping the stacks in it. Those stacks were leaked, and they kept counting towards `MAX_STACK_MAPPINGS`, after which new tasks fail to get a stack. Free all pooled stacks of an exited thread on every sweep instead. Assisted-by: Claude Code (Claude Opus 5.5)
Author
Parents
Loading