summary refs log tree commit diff
path: root/src/libextra
AgeCommit message (Collapse)AuthorLines
2014-01-08auto merge of #11370 : alexcrichton/rust/issue-10465, r=pwaltonbors-49/+39
Turned out to be a 2-line fix, but the compiler fallout was huge.
2014-01-08auto merge of #11405 : huonw/rust/moredocs, r=huonwbors-3/+3
Various documentation changes, change the 'borrowed pointer' terminology to 'reference', fix a problem with 'make dist' on windows.
2014-01-08auto merge of #11358 : pcwalton/rust/typed-arenas, r=alexcrichtonbors-33/+319
A typed arena is a type of arena that can only allocate objects of one type. It is 3x faster than the existing arena and 13x faster than malloc on Mac. r? @brson
2014-01-07extratest: Fix all leaked trait importsAlex Crichton-47/+39
2014-01-07Fix remaining cases of leaking importsAlex Crichton-2/+0
2014-01-07'borrowed pointer' -> 'reference'Brian Anderson-3/+3
2014-01-07libextra: Introduce typed arenas.Patrick Walton-33/+319
A typed arena is a type of arena that can only allocate objects of one type. It is 3x faster than the existing arena and 13x faster than malloc on Mac.
2014-01-08Renamed Option::map_default and mutate_default to map_or and mutate_or_setMarvin Löbel-12/+12
2014-01-07auto merge of #11263 : niftynif/rust/btree, r=catamorphismbors-115/+256
Apologies for junking up the feed with all of these separate pull requests. I'm still getting the hang of git and will hopefully be doing less of this nonsense soon. I opened up another PR and closed the one from earlier today because the first PR was coming from the wrong branch of my repo. Anyway, this contains a fleshed-out implementation of TotalEq/TotalOrd/Clone/ToStr for the whole B-tree structure and relevant tests, integrating suggestions and comments from several community members. r? @catamorphism
2014-01-07auto merge of #11342 : huonw/rust/trie-mut, r=alexcrichtonbors-30/+21
- Add `mut_iter`, `mut_lower_bound`, `mut_upper_bound` - Remove some internal iterators - Add benchmarks - Improve performance of `{mut_,}{lower,upper}_bound` - Minor clean-up of `extra::treemap` after I realised I wasn't exploiting macros to their full DRY potential.
2014-01-08extra::treemap: use the dummy-macro trick with items to make theHuon Wilson-16/+13
iterator macro properly hygiene. Requires less repetition of `mut` or not too.
2014-01-08std::trie: remove some obsolete internal iterators.Huon Wilson-14/+8
2014-01-07auto merge of #11329 : fhahn/rust/unused-cast-lint2, r=alexcrichtonbors-8/+8
Updates as mentioned in #11135
2014-01-06auto merge of #11296 : brson/rust/anti-cond, r=alexcrichtonbors-34/+48
In preparation for removing conditions.
2014-01-06Added in Clone/TotalEq/TotalOrd/ToStr traits to all parts of btree.Nif Ward-115/+256
Equals is now compact and uses vec's equals method. Cmp compares all elements on branches and leaves (Nodes).
2014-01-06Remove some unnecessary type castsFlorian Hahn-8/+8
Conflicts: src/librustc/middle/lint.rs
2014-01-06auto merge of #11333 : cmr/rust/triage2, r=alexcrichtonbors-1/+3
2014-01-05Remove a fixmeCorey Richardson-1/+3
I don't think it's relevant, a warning is more appropriate. Easier to just maintain the order. Closes #4681
2014-01-06extra::treemap: share code between the mutable and immutable iterators.Huon Wilson-271/+205
Yay for macros.
2014-01-06extra::treemap: remove mutate_values, replaced by .mut_iter().Huon Wilson-23/+0
2014-01-06extra::treemap: add mutable-value iterators.Huon Wilson-1/+278
2014-01-04Don't allow newtype structs to be dereferenced. #6246Brian Anderson-20/+46
2014-01-03auto merge of #11251 : pcwalton/rust/remove-at-mut, r=pcwaltonbors-79/+55
r? @nikomatsakis for the borrow checker changes. Write guards are now eliminated.
2014-01-03auto merge of #11280 : c-a/rust/inline_byteswap, r=brsonbors-0/+84
After writing some benchmarks for ebml::reader::vuint_at() I noticed that LLVM doesn't seem to inline the from_be32 function even though it only does a call to the bswap32 intrinsic in the x86_64 case. Marking the functions with #[inline(always)] fixes that and seems to me a reasonable thing to do. I got the following measurements in my vuint_at() benchmarks: - Before test ebml::bench::vuint_at_A_aligned ... bench: 1075 ns/iter (+/- 58) test ebml::bench::vuint_at_A_unaligned ... bench: 1073 ns/iter (+/- 5) test ebml::bench::vuint_at_D_aligned ... bench: 1150 ns/iter (+/- 5) test ebml::bench::vuint_at_D_unaligned ... bench: 1151 ns/iter (+/- 6) - Inline from_be32 test ebml::bench::vuint_at_A_aligned ... bench: 769 ns/iter (+/- 9) test ebml::bench::vuint_at_A_unaligned ... bench: 795 ns/iter (+/- 6) test ebml::bench::vuint_at_D_aligned ... bench: 758 ns/iter (+/- 8) test ebml::bench::vuint_at_D_unaligned ... bench: 759 ns/iter (+/- 8) - Using vuint_at_slow() test ebml::bench::vuint_at_A_aligned ... bench: 646 ns/iter (+/- 7) test ebml::bench::vuint_at_A_unaligned ... bench: 645 ns/iter (+/- 3) test ebml::bench::vuint_at_D_aligned ... bench: 907 ns/iter (+/- 4) test ebml::bench::vuint_at_D_unaligned ... bench: 1085 ns/iter (+/- 16) As expected inlining from_be32() gave a considerable speedup. I also tried how the "slow" version fared against the optimized version and noticed that it's actually a bit faster for small A class integers (using only two bytes) but slower for big D class integers (using four bytes)
2014-01-03extra: Remove condition from semverBrian Anderson-34/+48
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-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