]> git.lizzy.rs Git - rust.git/commit
auto merge of #10058 : alexcrichton/rust/uv-crate, r=brson
authorbors <bors@rust-lang.org>
Tue, 29 Oct 2013 16:36:47 +0000 (09:36 -0700)
committerbors <bors@rust-lang.org>
Tue, 29 Oct 2013 16:36:47 +0000 (09:36 -0700)
commit52f42f16387d0142944f376ea31c554c9caa2189
treee6e4d20d5c8d43c280d6c9ba02c063fe1ae11b2c
parente6650c87a3800264a043b7f129e6a4841c4cc3f7
parent201cab84e8f12ec73131ac4908e6779b277449a2
auto merge of #10058 : alexcrichton/rust/uv-crate, r=brson

This is one of the final steps needed to complete #9128. It still needs a little bit of polish before closing that issue, but it's in a pretty much "done" state now.

The idea here is that the entire event loop implementation using libuv is now housed in `librustuv` as a completely separate library. This library is then injected (via `extern mod rustv`) into executable builds (similarly to how libstd is injected, tunable via `#[no_uv]`) to bring in the "rust blessed event loop implementation."

Codegen-wise, there is a new `event_loop_factory` language item which is tagged on a function with 0 arguments returning `~EventLoop`. This function's symbol is then inserted into the crate map for an executable crate, and if there is no definition of the `event_loop_factory` language item then the value is null.

What this means is that embedding rust as a library in another language just got a little harder. Libraries don't have crate maps, which means that there's no way to find the event loop implementation to spin up the runtime. That being said, it's always possible to build the runtime manually. This request also makes more runtime components public which should probably be public anyway. This new public-ness should allow custom scheduler setups everywhere regardless of whether you follow the `rt::start `path.
src/librustc/middle/trans/base.rs
src/libstd/rt/sched.rs
src/libstd/rt/uv/uvio.rs