about summary refs log tree commit diff
path: root/src/libextra
AgeCommit message (Collapse)AuthorLines
2013-07-30auto merge of #8008 : bblum/rust/select, r=brsonbors-31/+23
Main logic in ```Implement select() for new runtime pipes.```. The guts of the ```PortOne::try_recv()``` implementation are now split up across several functions, ```optimistic_check```, ```block_on```, and ```recv_ready```. There is one weird FIXME I left open here, in the "implement select" commit -- an assertion I couldn't get to work in the receive path, on an invariant that for some reason doesn't hold with ```SharedPort```. Still investigating this.
2013-07-31FALSE is not 1u8 but 0u8, of cource.OGINO Masanori-1/+1
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2013-07-30std: Remove ManualThreads spawn modeBrian Anderson-1/+1
2013-07-31Fix comment.Dmitry Ermolov-1/+3
2013-07-30Fix opts_str.Dmitry Ermolov-3/+13
opt_val doesn't not fail! for missing options. Closes #6492
2013-07-30Modify test to expose issue #6492.Dmitry Ermolov-14/+31
2013-07-30UnsafeArc methods return unsafe pointers, so are not themselves unsafe.Ben Blum-3/+3
2013-07-30Unkillable is not unsafe. Close #7832.Ben Blum-28/+20
2013-07-30Do not enforce two newlines after the optionsJordi Boggiano-3/+2
2013-07-30auto merge of #8121 : thestinger/rust/offset, r=alexcrichtonbors-8/+8
Closes #8118, #7136 ~~~rust extern mod extra; use std::vec; use std::ptr; fn bench_from_elem(b: &mut extra::test::BenchHarness) { do b.iter { let v: ~[u8] = vec::from_elem(1024, 0u8); } } fn bench_set_memory(b: &mut extra::test::BenchHarness) { do b.iter { let mut v: ~[u8] = vec::with_capacity(1024); unsafe { let vp = vec::raw::to_mut_ptr(v); ptr::set_memory(vp, 0, 1024); vec::raw::set_len(&mut v, 1024); } } } fn bench_vec_repeat(b: &mut extra::test::BenchHarness) { do b.iter { let v: ~[u8] = ~[0u8, ..1024]; } } ~~~ Before: test bench_from_elem ... bench: 415 ns/iter (+/- 17) test bench_set_memory ... bench: 85 ns/iter (+/- 4) test bench_vec_repeat ... bench: 83 ns/iter (+/- 3) After: test bench_from_elem ... bench: 84 ns/iter (+/- 2) test bench_set_memory ... bench: 84 ns/iter (+/- 5) test bench_vec_repeat ... bench: 84 ns/iter (+/- 3)
2013-07-30Added str::char_offset_iter() and str::rev_char_offset_iter()Marvin Löbel-3/+99
Renamed bytes_iter to byte_iter to match other iterators Refactored str Iterators to use DoubleEnded Iterators and typedefs instead of wrapper structs Reordered the Iterator section Whitespace fixup Moved clunky `each_split_within` function to the one place in the tree where it's actually needed Replaced all block doccomments in str with line doccomments
2013-07-30implement pointer arithmetic with GEPDaniel Micay-8/+8
Closes #8118, #7136 ~~~rust extern mod extra; use std::vec; use std::ptr; fn bench_from_elem(b: &mut extra::test::BenchHarness) { do b.iter { let v: ~[u8] = vec::from_elem(1024, 0u8); } } fn bench_set_memory(b: &mut extra::test::BenchHarness) { do b.iter { let mut v: ~[u8] = vec::with_capacity(1024); unsafe { let vp = vec::raw::to_mut_ptr(v); ptr::set_memory(vp, 0, 1024); vec::raw::set_len(&mut v, 1024); } } } fn bench_vec_repeat(b: &mut extra::test::BenchHarness) { do b.iter { let v: ~[u8] = ~[0u8, ..1024]; } } ~~~ Before: test bench_from_elem ... bench: 415 ns/iter (+/- 17) test bench_set_memory ... bench: 85 ns/iter (+/- 4) test bench_vec_repeat ... bench: 83 ns/iter (+/- 3) After: test bench_from_elem ... bench: 84 ns/iter (+/- 2) test bench_set_memory ... bench: 84 ns/iter (+/- 5) test bench_vec_repeat ... bench: 84 ns/iter (+/- 3)
2013-07-30extra: Add .rev_iter() for bitvblake2-ppc-0/+5
2013-07-30extra: Implement iterator::Extendableblake2-ppc-21/+51
2013-07-30extra: Implement RandomAccessIterator for RingBufblake2-ppc-15/+26
2013-07-30extra: Implement DoubleEnded and RandomAccess iterators for bitvblake2-ppc-4/+35
2013-07-29std: Rename Iterator adaptor types to drop the -Iterator suffixblake2-ppc-12/+12
Drop the "Iterator" suffix for the the structs in std::iterator. Filter, Zip, Chain etc. are shorter type names for when iterator pipelines need their types written out in full in return value types, so it's easier to read and write. the iterator module already forms enough namespace.
2013-07-28Refactored vec and str iterators to remove prefixesjmgrosen-2/+3
2013-07-28auto merge of #8069 : erickt/rust/maikklein, r=ericktbors-16/+14
Good evening, This is a superset of @MaikKlein's #7969 commit, that I've fixed up to compile. I had a couple commits I wanted to do on top of @MaikKlein's work that I didn't want to bitrot.
2013-07-27to_either + fixesErick Tryzelaar-14/+13
2013-07-27cleanup .unwrap and .unwrap_err fixing io testsErick Tryzelaar-2/+1
2013-07-27Fix nits.Steven Stewart-Gallus-8/+9
2013-07-27Change concurrency primitives to standard naming conventionsSteven Stewart-Gallus-288/+290
To be more specific: `UPPERCASETYPE` was changed to `UppercaseType` `type_new` was changed to `Type::new` `type_function(value)` was changed to `value.method()`
2013-07-27auto merge of #8074 : thestinger/rust/iterator, r=cmrbors-11/+8
d7c9bb4 r=alexcrichton 7ae17e0 r=huonw
2013-07-27Remove dummy type parameters from iterator adaptorsblake2-ppc-11/+8
With the recent fixes to method resolution, we can now remove the dummy type parameters used as crutches in the iterator module. For example, the zip adaptor type is just ZipIterator<T, U> now.
2013-07-25Added default impls for container methodsSteven Fackler-23/+1
A couple of implementations of Container::is_empty weren't exactly self.len() == 0 so I left them alone (e.g. Treemap).
2013-07-25auto merge of #8015 : msullivan/rust/default-methods, r=nikomatsakisbors-0/+24
Lots of changes to vtable resolution, handling of super/self method calls in default methods. Fix a lot of trait inheritance bugs. r? @nikomatsakis
2013-07-24auto merge of #7996 : erickt/rust/cleanup-strs, r=ericktbors-29/+29
This is a cleanup pull request that does: * removes `os::as_c_charp` * moves `str::as_buf` and `str::as_c_str` into `StrSlice` * converts some functions from `StrSlice::as_buf` to `StrSlice::as_c_str` * renames `StrSlice::as_buf` to `StrSlice::as_imm_buf` (and adds `StrSlice::as_mut_buf` to match `vec.rs`. * renames `UniqueStr::as_bytes_with_null_consume` to `UniqueStr::to_bytes` * and other misc cleanups and minor optimizations
2013-07-24rc: Use ~T for allocationblake2-ppc-47/+43
Simplify Rc<T>/RcMut<T> by using ~T when allocating a reference counted box.
2013-07-24Change 'print(fmt!(...))' to printf!/printfln! in src/lib*Birunthan Mohanathas-11/+11
2013-07-23Fix some impls such that all supertraits are actually implemented.Michael Sullivan-0/+24
2013-07-23clean up warningsErick Tryzelaar-1/+1
2013-07-23std: remove str::to_owned and str::raw::slice_bytes_ownedErick Tryzelaar-22/+22
2013-07-23std: move StrUtil::as_c_str into StrSliceErick Tryzelaar-5/+5
2013-07-23std: rename str.as_bytes_with_null_consume to str.to_bytes_with_nullErick Tryzelaar-1/+1
2013-07-23extra: rebase fallout.Graydon Hoare-1/+1
2013-07-23extra: give up trying to make more fields of context cloneable, just use ARCs.Graydon Hoare-16/+28
2013-07-23extra: switch json from hashmaps to treemapsGraydon Hoare-15/+13
2013-07-23extra: add consume iter to treemap.Graydon Hoare-0/+63
2013-07-23extra: clean up workcache to use & in place of @ most places.Graydon Hoare-58/+71
2013-07-23extra: remove a @ in workcache config.Graydon Hoare-3/+3
2013-07-23extra: change workcache::Work::unwrap to move out of self.Graydon Hoare-26/+18
2013-07-23extra: access workcache db via RWARC.Graydon Hoare-13/+17
2013-07-23extra: use deriving more in workcache, switch to treemaps.Graydon Hoare-71/+22
2013-07-23auto merge of #7944 : blake2-ppc/rust/dlist-move-nodes, r=bblumbors-138/+199
Factor out internal methods to pop/push list nodes so that .merge() and .rotate_to_front(), .rotate_to_back() (new methods) can be implemented without allocating nodes. With that, some cleanup changes to DList use of Option, and adding a missing Encodable implementation.
2013-07-23auto merge of #7934 : sfackler/rust/smallintset, r=alexcrichtonbors-369/+0
SmallIntSet is equivalent to BitvSet but with 64 times the memory overhead. There's no reason for it to exist. SmallIntSet's overhead should really only be 8 times, but for some reason, `sys::size_of::<Option<()>>() == 8`, not 1.
2013-07-22auto merge of #7703 : sfackler/rust/bitv, r=alexcrichtonbors-51/+149
Switched Bitv and BitvSet to external iterators. They still use some internal iterators internally (ha). Derived clone for all Bitv types. Removed indirection in BitvVariant. It previously held a unique pointer to the appropriate Bitv struct, even though those structs are the size of a pointer themselves. BitvVariant is the same size (16 bytes) as it was previously.
2013-07-23dlist: Rename rotate methods to .rotate_forward() and .rotate_backward()blake2-ppc-15/+15
2013-07-22std: Move change_dir_locked to unstable. #7870Brian Anderson-2/+4
2013-07-22extra: Add url moduleBrian Anderson-0/+1072
Used to be under extra::net, which no longer exists