about summary refs log tree commit diff
path: root/src/libextra
AgeCommit message (Collapse)AuthorLines
2014-01-03libstd: Remove all support code related to `@mut`Patrick Walton-12/+0
2014-01-03libextra: Remove `MutList`, as it's inexorably tied to `@mut`Patrick Walton-27/+0
2014-01-03libextra: Remove unnecessary `@mut`sPatrick Walton-13/+21
2014-01-03libextra: De-`@mut` the arenaPatrick Walton-27/+34
2014-01-03auto merge of #11149 : alexcrichton/rust/remove-either, r=brsonbors-10/+15
Had to change some stuff in typeck to bootstrap (getting methods in fmt off of Either), but other than that not so painful. Closes #9157
2014-01-03Remove std::eitherAlex Crichton-10/+15
2014-01-02libextra: Add benchmarks for ebml::reader::vuint_at()Carl-Anton Ingmarsson-0/+84
2014-01-02Bump version to 0.9Brian Anderson-1/+1
2014-01-01libextra: Use from_be32 instead of bswap32 in vuint_at()Carl-Anton Ingmarsson-9/+2
Also use the fast version of vuint_at() on all architectures since it now works on both big and little endian architectures.
2013-12-31Added Freeze trait to CowArcColin Sherratt-2/+2
2013-12-31Add a copy-on-write container.Colin Sherratt-0/+108
2013-12-31auto merge of #11208 : alexcrichton/rust/less-c, r=cmrbors-10/+96
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-31Fix testsAlan Andrade-1/+1
2013-12-30Avoid compiler error about glob imports in getopts exampleAlan Andrade-1/+1
2013-12-30Convert some C functions to rust functionsAlex Crichton-10/+96
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-30Implement Ratio:from_float()Volker Mische-1/+60
The Ratio::from_float() converts a float (f32 and f64) into a Ratio<BigInt>. Closes #9838
2013-12-27librustc: Implement coercion for traits.Luqman Aden-1/+1
2013-12-26libextra: Stop using `@mut MemWriter` in the EBML modulePatrick Walton-40/+44
2013-12-26Register new snapshotsAlex Crichton-2/+0
2013-12-25Test fixes and rebase conflictsAlex Crichton-26/+19
* 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-1/+1
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-24green: Rip the bandaid off, introduce libgreenAlex Crichton-15/+3
This extracts everything related to green scheduling from libstd and introduces a new libgreen crate. This mostly involves deleting most of std::rt and moving it to libgreen. Along with the movement of code, this commit rearchitects many functions in the scheduler in order to adapt to the fact that Local::take now *only* works on a Task, not a scheduler. This mostly just involved threading the current green task through in a few locations, but there were one or two spots where things got hairy. There are a few repercussions of this commit: * tube/rc have been removed (the runtime implementation of rc) * There is no longer a "single threaded" spawning mode for tasks. This is now encompassed by 1:1 scheduling + communication. Convenience methods have been introduced that are specific to libgreen to assist in the spawning of pools of schedulers.
2013-12-24std: Introduce std::syncAlex Crichton-66/+4
For now, this moves the following modules to std::sync * UnsafeArc (also removed unwrap method) * mpsc_queue * spsc_queue * atomics * mpmc_bounded_queue * deque We may want to remove some of the queues, but for now this moves things out of std::rt into std::sync
2013-12-23extra: impl IterBytes for uuid::UuidJeff Olson-0/+17
2013-12-23Fixing more doc testsAlex Crichton-1/+1
2013-12-23extra: Fix all code examplesAlex Crichton-39/+58
2013-12-22auto merge of #11109 : sfackler/rust/arc, r=alexcrichtonbors-15/+58
Closes #11097
2013-12-22auto merge of #11101 : jhasse/rust/patch-msys-quickfix, r=luqmanabors-1/+1
I had this fixed but somehow forgot to commit it in my final patch. Sorry!
2013-12-22auto merge of #11064 : huonw/rust/vec-sort, r=alexcrichtonbors-1206/+35
This uses quite a bit of unsafe code for speed and failure safety, and allocates `2*n` temporary storage. [Performance](https://gist.github.com/huonw/5547f2478380288a28c2): | n | new | priority_queue | quick3 | |-------:|---------:|---------------:|---------:| | 5 | 200 | 155 | 106 | | 100 | 6490 | 8750 | 5810 | | 10000 | 1300000 | 1790000 | 1060000 | | 100000 | 16700000 | 23600000 | 12700000 | | sorted | 520000 | 1380000 | 53900000 | | trend | 1310000 | 1690000 | 1100000 | (The times are in nanoseconds, having subtracted the set-up time (i.e. the `just_generate` bench target).) I imagine that there is still significant room for improvement, particularly because both priority_queue and quick3 are doing a static call via `Ord` or `TotalOrd` for the comparisons, while this is using a (boxed) closure. Also, this code does not `clone`, unlike `quick_sort3`; and is stable, unlike both of the others.
2013-12-22std::vec: make the sorting closure use `Ordering` rather than just beingHuon Wilson-12/+24
(implicitly) less_eq.
2013-12-21Remove unneccessary mut from arcSteven Fackler-4/+4
2013-12-21Don't poison ARCs that are used while unwindingSteven Fackler-12/+55
Closes #11097
2013-12-21Remove unnecessary semicolonJan Niklas Hasse-1/+1
2013-12-20auto merge of #11031 : jhasse/rust/patch-msys-3, r=cmrbors-45/+28
Enable ANSI colors if TERM is set to cygwin and terminfo is not available (msys terminal on Windows). See #2807
2013-12-21std::vec: add a sugary .sort() method for plain Ord sorting.Huon Wilson-9/+12
This moves the custom sorting to `.sort_by`.
2013-12-20Support ANSI colors in msys terminals. See #2807Jan Niklas Hasse-45/+28
2013-12-19auto merge of #11071 : huonw/rust/quiet-test, r=cmrbors-11/+6
2013-12-20extra: remove sort in favour of the std method.Huon Wilson-1203/+17
Fixes #9676.
2013-12-19auto merge of #11057 : alexcrichton/rust/no-at-in-ebml, r=pcwaltonbors-54/+52
Now that the metadata is an owned value with a lifetime of a borrowed byte slice, it's possible to have future optimizations where the metadata doesn't need to be copied around (very expensive operation).
2013-12-19Purge @-boxes from the reading half of EBMLAlex Crichton-54/+52
Now that the metadata is an owned value with a lifetime of a borrowed byte slice, it's possible to have future optimizations where the metadata doesn't need to be copied around (very expensive operation).
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-20extra: silence warnings during testing.Huon Wilson-11/+6
2013-12-18auto merge of #10927 : g3xzh/rust/sum_bugfix, r=huonwbors-1/+66
`[1e20, 1.0, -1e20].sum()` returns `0.0`. This happens because during the summation, `1.0` is too small relative to `1e20`, making it negligible. I have tried Kahan summation but it hasn't fixed the problem. Therefore, I've used Python's `fsum()` implementation. For more details, read: www.cs.cmu.edu/~quake-papers/robust-arithmetic.ps https://github.com/mozilla/rust/issues/10851 Python's fsum (msum) http://code.activestate.com/recipes/393090/ @huonw, your feedback is more than welcome. It looks unpolished; Do you have suggestions how to make it more beautiful and elegant? Thanks in advance,
2013-12-18auto merge of #11029 : huonw/rust/rm-vec-as-buf, r=cmrbors-28/+22
For `str.as_mut_buf`, un-closure-ification is achieved by outright removal (see commit message). The others are replaced by `.as_ptr`, `.as_mut_ptr` and `.len`
2013-12-19Fix `sum()` accuracyg3xzh-1/+66
`[1e20, 1.0, -1e20].sum()` returns `0.0`. This happens because during the summation, `1.0` is too small relative to `1e20`, making it negligible. I have tried Kahan summation but it hasn't fixed the problem. Therefore, I've used Python's `fsum()` implementation with some help from Jason Fager and Huon Wilson. For more details, read: www.cs.cmu.edu/~quake-papers/robust-arithmetic.ps Moreover, benchmark and unit tests were added. Note: `Status.sum` is still not fully fixed. It doesn't handle NaNs, infinities and overflow correctly. See issue 11059: https://github.com/mozilla/rust/issues/11059
2013-12-19std::vec: remove .as_imm_buf, replaced by .as_ptr & .len.Huon Wilson-28/+22
There's no need for the restrictions of a closure with the above methods.
2013-12-17Don't allow impls to force public typesAlex Crichton-7/+6
This code in resolve accidentally forced all types with an impl to become public. This fixes it by default inheriting the privacy of what was previously there and then becoming `true` if nothing else exits. Closes #10545
2013-12-17auto merge of #10996 : huonw/rust/more-vec-raw, r=cmrbors-3/+1
The removal of the aliasing &mut[] and &[] from `shift_opt` also comes with its simplification. The above also allows the use of `copy_nonoverlapping_memory` in `[].copy_memory` (I did an audit of each use of `.copy_memory` and `std::vec::bytes::copy_memory`, and I believe none of them are called with arguments can ever alias). This changes requires that `unsafe` code using `copy_memory` **needs** to respect the aliasing rules of `&mut[]`.
2013-12-16Test fallout from std::comm rewriteAlex Crichton-3/+2