mozilla/rust — pull request #12981 by alexcrichton (2014-03-17 18:22:55+00:00)
Title: comm: Impose an artificial bound on channel size 

This commit adds an artificial and "very high" bound on the size of an unbounded
asynchronous channel. An unbounded channel runs the risk of memory exhaustions,
resulting in a process abort (currently OOM is not a fail!()). This is often a
disastrous failure mode, so instead this commit attempts to mitigate some of the
worry by imposing a large limit which will theoretically get triggered before
hitting OOM.

This commit also adds an ability to sidestep these assertions by using the
`unchecked_channel` method to create a Sender/Receiver pair. This function is
currently marked as `#[experimental]` due to leaking implementation
abstractions.