mozilla/rust — pull request #6581 by brson (2013-05-18 03:47:17+00:00)
Title: rt: Release big stacks immediately after use to avoid holding on to them...

... through yields

r? @pcwalton

This avoids the following pathological scenario that makes threadring OOM:

1) task calls C using fast_ffi, borrowing a big stack from the scheduler.
2) task returns from C and places the big stack on the task-local stack segment list
3) task calls further Rust functions that require growing the stack, and for this reuses the big stack
4) task yields, failing to return the big stack to the scheduler.
5) repeat 500+ times and OOM

Fixes #5985