summary refs log tree commit diff
path: root/src/librustuv
AgeCommit message (Collapse)AuthorLines
2014-01-07Fixup the rest of the tests in the compilerAlex Crichton-1/+1
2014-01-07Fix remaining cases of leaking importsAlex Crichton-1/+1
2014-01-08Renamed Option::map_default and mutate_default to map_or and mutate_or_setMarvin Löbel-1/+1
2014-01-04Don't allow newtype structs to be dereferenced. #6246Brian Anderson-5/+8
2014-01-02Bump version to 0.9Brian Anderson-1/+1
2013-12-30Convert some C functions to rust functionsAlex Crichton-0/+4
Right now on linux, an empty executable with LTO still depends on librt becaues of the clock_gettime function in rust_builtin.o, but this commit moves this dependency into a rust function which is subject to elimination via LTO. At the same time, this also drops libstd's dependency on librt on unices that are not OSX because the library is only used by extra::time (and now the dependency is listed in that module instead).
2013-12-27Implement native TCP I/OAlex Crichton-1/+4
2013-12-26Register new snapshotsAlex Crichton-2/+0
2013-12-25Test fixes and rebase conflictsAlex Crichton-9/+7
* vec::raw::to_ptr is gone * Pausible => Pausable * Removing @ * Calling the main task "<main>" * Removing unused imports * Removing unused mut * Bringing some libextra tests up to date * Allowing compiletest to work at stage0 * Fixing the bootstrap-from-c rmake tests * assert => rtassert in a few cases * printing to stderr instead of stdout in fail!()
2013-12-24std: Remove must deferred sending functionsAlex Crichton-4/+4
These functions are all unnecessary now, and they only have meaning in the M:N context. Removing these functions uncovered a bug in the librustuv timer bindings, but it was fairly easy to cover (and the test is already committed). These cannot be completely removed just yet due to their usage in the WaitQueue of extra::sync, and until the mutex in libextra is rewritten it will not be possible to remove the deferred sends for channels.
2013-12-24rustuv: Remove the id() function from IoFactoryAlex Crichton-27/+27
The only user of this was the homing code in librustuv, and it just manually does the cast from a pointer to a uint now.
2013-12-24rustuv: Fix a use-after-free on destructionAlex Crichton-2/+12
The uv loop was being destroyed before the async handle was being destroyed, so closing the async handle was causing a use-after-free in the uv loop. This was fixed by moving destruction of the queue's async handle to an earlier location and then actually freeing it once the loop has been dropped.
2013-12-24rustuv: Fix a use-after-free bugAlex Crichton-3/+7
The queue has an async handle which must be destroyed before the loop is destroyed, so use a little bit of an option dance to get around this requirement.
2013-12-24Test fixes and rebase problemsAlex Crichton-0/+4
Note that this removes a number of run-pass tests which are exercising behavior of the old runtime. This functionality no longer exists and is thoroughly tested inside of libgreen and libnative. There isn't really the notion of "starting the runtime" any more. The major notion now is "bootstrapping the initial task".
2013-12-24green: Fixing all tests from previous refactoringsAlex Crichton-3/+3
2013-12-24green: Allow specifying an IoFactory for poolsAlex Crichton-3/+9
This allows creation of different sched pools with different io factories. Namely, this will be used to test the basic I/O loop in the green crate. This can also be used to override the global default.
2013-12-24rustuv: Write homing tests with SchedPoolAlex Crichton-108/+45
Use the previous commit's new scheduler pool abstraction in libgreen to write some homing tests which force an I/O handle to be homed from one event loop to another.
2013-12-24rustuv: Get all tests passing again after refactorAlex Crichton-310/+284
All tests except for the homing tests are now working again with the librustuv/libgreen refactoring. The homing-related tests are currently commented out and now placed in the rustuv::homing module. I plan on refactoring scheduler pool spawning in order to enable more homing tests in a future commit.
2013-12-24rustuv: Reimplement without using std::rt::schedAlex Crichton-400/+644
This reimplements librustuv without using the interfaces provided by the scheduler in libstd. This solely uses the new Runtime trait in order to interface with the local task and perform the necessary scheduling operations. The largest snag in this refactoring is reimplementing homing. The new runtime trait exposes no concept of "homing" a task or forcibly sending a task to a remote scheduler (there is no concept of a scheduler). In order to reimplement homing, the transferrence of tasks is now done at the librustuv level instead of the scheduler level. This means that all I/O loops now have a concurrent queue which receives homing messages and requests. This allows the entire implementation of librustuv to be only dependent on the runtime trait, severing all dependence of librustuv on the scheduler and related green-thread functions. This is all in preparation of the introduction of libgreen and libnative. At the same time, I also took the liberty of removing all glob imports from librustuv.
2013-12-21rustuv: Stop link to pthread on Windowsklutzy-1/+3
2013-12-19auto merge of #11041 : cmr/rust/pkgid_changes, r=cmr,metajackbors-0/+2
2013-12-19Rename pkgid to crate_idCorey Richardson-0/+2
Closes #11035
2013-12-19std::vec: remove .as_imm_buf, replaced by .as_ptr & .len.Huon Wilson-3/+3
There's no need for the restrictions of a closure with the above methods.
2013-12-17auto merge of #10863 : cadencemarseille/rust/patch-handle-ENOENT, r=alexcrichtonbors-0/+4
Translate ENOENT to IoErrorKind::FileNotFound.
2013-12-17Handle ENOENTCadence Marseille-0/+4
Translate ENOENT to IoErrorKind::FileNotFound.
2013-12-16Test fallout from std::comm rewriteAlex Crichton-39/+51
2013-12-16Fallout of rewriting std::commAlex Crichton-6/+5
2013-12-15Register new snapshotsAlex Crichton-8/+1
Understand 'pkgid' in stage0. As a bonus, the snapshot now contains now metadata (now that those changes have landed), and the snapshot download is half as large as it used to be!
2013-12-15auto merge of #10984 : huonw/rust/clean-raw, r=cmrbors-10/+7
See commits for details.
2013-12-15std::vec: convert to(_mut)_ptr to as_... methods on &[] and &mut [].Huon Wilson-9/+6
2013-12-15Move std::{str,vec}::raw::set_len to an unsafe method on Owned{Vector,Str}.Huon Wilson-1/+1
2013-12-15std::rt: s/pausible/pausable/.Huon Wilson-5/+5
2013-12-14Dead-code pass now marks and warns foreign itemsKiet Tran-1/+6
2013-12-10auto merge of #10791 : pcwalton/rust/decelling, r=pcwaltonbors-101/+83
34 uses of `Cell` remain. r? @alexcrichton
2013-12-10libstd: Remove `Cell` from the library.Patrick Walton-15/+14
2013-12-10Make crate hash stable and externally computable.Jack Moffitt-0/+2
This replaces the link meta attributes with a pkgid attribute and uses a hash of this as the crate hash. This makes the crate hash computable by things other than the Rust compiler. It also switches the hash function ot SHA1 since that is much more likely to be available in shell, Python, etc than SipHash. Fixes #10188, #8523.
2013-12-10librustuv: Change `with_local_io` to use RAII.Patrick Walton-2/+6
2013-12-10librustdoc: Remove a couple of `Cell`s.Patrick Walton-3/+4
2013-12-10librustuv: RAII-ify `Local::borrow`, and remove some 12 Cells.Patrick Walton-19/+29
2013-12-10libextra: Another round of de-`Cell`-ing.Patrick Walton-71/+39
34 uses of `Cell` remain.
2013-12-08Remove dead codesKiet Tran-12/+0
2013-12-04auto merge of #10796 : kballard/rust/revert-new-naming, r=alexcrichtonbors-4/+4
Rename the `*::init()` functions back to `*::new()`, since `new` is not going to become a keyword.
2013-12-04Rename std::rt::deque::*::init() to *::new()Kevin Ballard-1/+1
2013-12-04Revert "libstd: Change `Path::new` to `Path::init`."Kevin Ballard-3/+3
This reverts commit c54427ddfbbab41a39d14f2b1dc4f080cbc2d41b. Leave the #[ignores] in that were added to rustpkg tests. Conflicts: src/librustc/driver/driver.rs src/librustc/metadata/creader.rs
2013-12-04auto merge of #10804 : alexcrichton/rust/less-dup, r=pcwaltonbors-0/+8
This is just an implementation detail of using libuv, so move the libuv-specific logic into librustuv.
2013-12-04Don't dup the stdio file descriptors.Alex Crichton-0/+8
This is just an implementation detail of using libuv, so move the libuv-specific logic into librustuv.
2013-12-04std::str: s/from_utf8_slice/from_utf8/, to make the basic case shorter.Huon Wilson-2/+2
2013-12-04std::str: remove from_utf8.Huon Wilson-2/+2
This function had type &[u8] -> ~str, i.e. it allocates a string internally, even though the non-allocating version that take &[u8] -> &str and ~[u8] -> ~str are all that is necessary in most circumstances.
2013-12-03Move std::util::ignore to std::prelude::dropSteven Fackler-6/+3
It's a more fitting name for the most common use case of this function.
2013-12-03Register new snapshotsAlex Crichton-20/+7