summary refs log tree commit diff
path: root/src/libstd/rt
AgeCommit message (Collapse)AuthorLines
2013-12-15std::vec: convert to(_mut)_ptr to as_... methods on &[] and &mut [].Huon Wilson-2/+2
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-18/+18
2013-12-15std: fix spelling in docs.Huon Wilson-1/+1
2013-12-11Make 'self lifetime illegal.Erik Price-9/+9
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-12-10auto merge of #10791 : pcwalton/rust/decelling, r=pcwaltonbors-307/+311
34 uses of `Cell` remain. r? @alexcrichton
2013-12-10libstd: Remove `Cell` from the library.Patrick Walton-13/+18
2013-12-10Make crate hash stable and externally computable.Jack Moffitt-2/+0
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-10libstd: Remove two uses of `Cell`.Patrick Walton-6/+4
2013-12-10libstd: Change `atomically` to use RAII.Patrick Walton-11/+7
2013-12-10librustuv: Change `with_local_io` to use RAII.Patrick Walton-25/+53
2013-12-10libstd: Remove some cells involved inPatrick Walton-10/+6
`deschedule_running_task_and_then`.
2013-12-10librustuv: RAII-ify `Local::borrow`, and remove some 12 Cells.Patrick Walton-146/+168
2013-12-10libextra: Another round of de-`Cell`-ing.Patrick Walton-110/+69
34 uses of `Cell` remain.
2013-12-08Remove dead codesKiet Tran-22/+6
2013-12-06auto merge of #10364 : Kimundi/rust/result_compose, r=alexcrichtonbors-0/+1
This implements parts of the changes to `Result` and `Option` I proposed and discussed in this thread: https://mail.mozilla.org/pipermail/rust-dev/2013-November/006254.html This PR includes: - Adding `ok()` and `err()` option adapters for both `Result` variants. - Removing `get_ref`, `expect` and iterator constructors for `Result`, as they are reachable with the variant adapters. - Removing `Result`s `ToStr` bound on the error type because of composability issues. (See https://mail.mozilla.org/pipermail/rust-dev/2013-November/006283.html) - Some warning cleanups
2013-12-06Link rustllvm statically, and distribute a static snapshotAlex Crichton-0/+1
In order to keep up to date with changes to the libraries that `llvm-config` spits out, the dependencies to the LLVM are a dynamically generated rust file. This file is now automatically updated whenever LLVM is updated to get kept up-to-date. At the same time, this cleans out some old cruft which isn't necessary in the makefiles in terms of dependencies. Closes #10745 Closes #10744
2013-12-06Made Results API more composableMarvin Löbel-0/+1
2013-12-05auto merge of #10817 : alexcrichton/rust/sched-fix, r=brsonbors-4/+49
Right now, as pointed out in #8132, it is very easy to introduce a subtle race in the runtime. I believe that this is the cause of the current flakiness on the bots. I have taken the last idea mentioned in that issue which is to use a lock around descheduling and context switching in order to solve this race. Closes #8132
2013-12-05Solve some nasty deschedulinging races with a lockAlex Crichton-4/+49
Right now, as pointed out in #8132, it is very easy to introduce a subtle race in the runtime. I believe that this is the cause of the current flakiness on the bots. I have taken the last idea mentioned in that issue which is to use a lock around descheduling and context switching in order to solve this race. Closes #8132
2013-12-04Rename std::rt::deque::*::init() to *::new()Kevin Ballard-20/+20
2013-12-04Revert "libstd: Change `Path::new` to `Path::init`."Kevin Ballard-1/+1
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-03Move std::util::ignore to std::prelude::dropSteven Fackler-2/+1
It's a more fitting name for the most common use case of this function.
2013-12-03auto merge of #10747 : alexcrichton/rust/snapshots, r=cmrbors-5/+0
This registers new snapshots after the landing of #10528, and then goes on to tweak the build process to build a monolithic `rustc` binary for use in future snapshots. This mainly involved dropping the dynamic dependency on `librustllvm`, so that's now built as a static library (with a dynamically generated rust file listing LLVM dependencies). This currently doesn't actually make the snapshot any smaller (24MB => 23MB), but I noticed that the executable has 11MB of metadata so once progress is made on #10740 we should have a much smaller snapshot. There's not really a super-compelling reason to distribute just a binary because we have all the infrastructure for dealing with a directory structure, but to me it seems "more correct" that a snapshot compiler is just a `rustc` binary.
2013-12-03Register new snapshotsAlex Crichton-5/+0
2013-11-30auto merge of #10733 : alexcrichton/rust/ignore-on-windows, r=pcwaltonbors-0/+1
I've seen this fail on windows twice now, and it's not clear to me why it's failing. For now, ignore it on that platform while investigation enuses.
2013-11-29Ignore a deque test on windowsAlex Crichton-0/+1
I've seen this fail on windows twice now, and it's not clear to me why it's failing. For now, ignore it on that platform while investigation enuses.
2013-11-29auto merge of #10719 : Kimundi/rust/switch_to_multi_item_macros, r=alexcrichtonbors-2/+1
- Removed module reexport workaround for the integer module macros - Removed legacy reexports of `cmp::{min, max}` in the integer module macros - Combined a few macros in `vec` into one - Documented a few issues
2013-11-29Implement a lock-free work-stealing dequeAlex Crichton-132/+714
This adds an implementation of the Chase-Lev work-stealing deque to libstd under std::rt::deque. I've been unable to break the implementation of the deque itself, and it's not super highly optimized just yet (everything uses a SeqCst memory ordering). The major snag in implementing the chase-lev deque is that the buffers used to store data internally cannot get deallocated back to the OS. In the meantime, a shared buffer pool (synchronized by a normal mutex) is used to deallocate/allocate buffers from. This is done in hope of not overcommitting too much memory. It is in theory possible to eventually free the buffers, but one must be very careful in doing so. I was unable to get some good numbers from src/test/bench tests (I don't think many of them are slamming the work queue that much), but I was able to get some good numbers from one of my own tests. In a recent rewrite of select::select(), I found that my implementation was incredibly slow due to contention on the shared work queue. Upon switching to the parallel deque, I saw the contention drop to 0 and the runtime go from 1.6s to 0.9s with the most amount of time spent in libuv awakening the schedulers (plus allocations). Closes #4877
2013-11-29Removed useless cmp::{min, max} reexports from the integer modulesMarvin Löbel-2/+1
2013-11-29libstd: Change `Path::new` to `Path::init`.Patrick Walton-1/+1
2013-11-28Register new snapshotsAlex Crichton-10/+9
2013-11-27Use the native tls implementation on androidAlex Crichton-248/+227
Turns out android doesn't support LLVM's thread_local attribute and accompanying implementation. Closes #10686
2013-11-27Improve the rt::thread moduleAlex Crichton-61/+153
* Added doc comments explaining what all public functionality does. * Added the ability to spawn a detached thread * Added the ability for the procs to return a value in 'join'
2013-11-26Clean up statically initialized data on shutdownAlex Crichton-14/+55
Whenever the runtime is shut down, add a few hooks to clean up some of the statically initialized data of the runtime. Note that this is an unsafe operation because there's no guarantee on behalf of the runtime that there's no other code running which is using the runtime. This helps turn down the noise a bit in the valgrind output related to statically initialized mutexes. It doesn't turn the noise down to 0 because there are still statically initialized mutexes in dynamic_lib and os::with_env_lock, but I believe that it would be easy enough to add exceptions for those cases and I don't think that it's the runtime's job to go and clean up that data.
2013-11-26auto merge of #10312 : thestinger/rust/thread_local, r=alexcritchtonbors-5/+105
This provides a building block for fast thread-local storage. It does not change the safety semantics of `static mut`. Closes #10310
2013-11-26port the runtime to `#[thread_local]`Daniel Micay-5/+105
2013-11-26librustc: Fix merge fallout.Patrick Walton-5/+5
2013-11-26libstd: Fix Win32 and other bustage.Patrick Walton-5/+5
2013-11-26librustc: Make `||` lambdas not infer to `proc`sPatrick Walton-26/+34
2013-11-26test: Remove non-procedure uses of `do` from compiletest, libstd tests,Patrick Walton-40/+40
compile-fail tests, run-fail tests, and run-pass tests.
2013-11-26libstd: Remove all non-`proc` uses of `do` from libstdPatrick Walton-154/+131
2013-11-26Removed unneccessary `_iter` suffixes from various APIsMarvin Löbel-4/+4
2013-11-25auto merge of #10631 : klutzy/rust/win-fixes, r=alexcrichtonbors-4/+9
This patchset fixes some parts broken on Win64. This also adds `--disable-pthreads` flags to llvm on mingw-w64 archs (both 32-bit and 64-bit, not mingw) due to bad performance. See #8996 for discussion.
2013-11-25auto merge of #10643 : jorendorff/rust/master, r=alexcrichtonbors-1/+1
2013-11-24auto merge of #10603 : alexcrichton/rust/no-linked-failure, r=brsonbors-752/+36
The reasons for doing this are: * The model on which linked failure is based is inherently complex * The implementation is also very complex, and there are few remaining who fully understand the implementation * There are existing race conditions in the core context switching function of the scheduler, and possibly others. * It's unclear whether this model of linked failure maps well to a 1:1 threading model Linked failure is often a desired aspect of tasks, but we would like to take a much more conservative approach in re-implementing linked failure if at all. Closes #8674 Closes #8318 Closes #8863
2013-11-24Remove linked failure from the runtimeAlex Crichton-752/+36
The reasons for doing this are: * The model on which linked failure is based is inherently complex * The implementation is also very complex, and there are few remaining who fully understand the implementation * There are existing race conditions in the core context switching function of the scheduler, and possibly others. * It's unclear whether this model of linked failure maps well to a 1:1 threading model Linked failure is often a desired aspect of tasks, but we would like to take a much more conservative approach in re-implementing linked failure if at all. Closes #8674 Closes #8318 Closes #8863
2013-11-24Fix spelling of "vacuum" in one of the abort quotes.Jason Orendorff-1/+1
2013-11-24std::rt: Fix crate_map on Win64klutzy-1/+6
2013-11-24std::rt: Fix record_stack_bounds on win64klutzy-2/+2