about summary refs log tree commit diff
path: root/src/libextra
AgeCommit message (Collapse)AuthorLines
2013-08-04extra: Don't recurse in DList drop glue. #8295Brian Anderson-4/+38
The compiler-generated dtor for DList recurses deeply to drop Nodes. For big lists this can overflow the stack.
2013-08-04auto merge of #8282 : brson/rust/more-newsched-fixes, r=brsonbors-8/+1
2013-08-04Merge remote-tracking branch 'remotes/origin/master' into str-remove-nullErick Tryzelaar-246/+236
2013-08-04Remove trailing null from stringsErick Tryzelaar-2/+98
2013-08-04Remove old tests and code for `select`Brian Anderson-8/+1
Not compatible with newsched
2013-08-04auto merge of #8260 : omasanori/rust/fix-extra-unicode, r=pcwaltonbors-18/+33
WIth this patch `RUSTFLAGS='--cfg unicode' make check"` passed successfully. * Why doesn't `#[link_name="icuuc"]` make libextra to link against libicuuc.so? * In `extra::unicode::tests`, `use unicode; unicode::is_foo('a')` failed but `use unicode::*; is_foo('a')` succeeded. Is it right?
2013-08-04std: replace str::as_c_str with std::c_strErick Tryzelaar-6/+6
2013-08-04extra: make sure time::match_digits does not read past the end of the strErick Tryzelaar-7/+11
2013-08-04Implemented TreeMap::{lower_bound_iter,upper_bound_iter}Dmitry Ermolov-4/+146
(issue #4604)
2013-08-04Remove redundant print.Dmitry Ermolov-1/+0
2013-08-04Additional check in treemap iterator test.Dmitry Ermolov-0/+1
2013-08-03auto merge of #8264 : thestinger/rust/snapshot, r=Aatchbors-236/+236
2013-08-03remove obsolete `foreach` keywordDaniel Micay-236/+236
this has been replaced by `for`
2013-08-03auto merge of #8246 : stepancheg/rust/contains-key, r=thestingerbors-10/+0
Map::contains_key can be implemented with Map::find. Remove several implementations of contains_key.
2013-08-03Fix building problems in extra::unicode.OGINO Masanori-18/+33
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2013-08-03Move `use` statements.OGINO Masanori-6/+8
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2013-08-03Rename sum -> _sum.OGINO Masanori-6/+6
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2013-08-03Explicitly impl Clone for RWArcKevin Ballard-14/+12
RWArc had a clone() method, but it was part of impl RWArc instead of an implementation of Clone. Stick with the explicit implementation instead of deriving Clone so we can have a docstring. Fixes #8052.
2013-08-03replace all remaining `for` with `foreach` or `do`Daniel Micay-41/+52
2013-08-02librustc: Disallow "unsafe" for external functionsPatrick Walton-35/+31
2013-08-02auto merge of #8174 : DaGenix/rust/digest-improvements, r=brsonbors-850/+912
Same content as #8097, but bors had an issue with that pull request. Opening a new one.
2013-08-03Add default implementation of Map::contains_key functionStepan Koltsov-10/+0
Map::contains_key can be implemented with Map::find. Remove several implementations of contains_key.
2013-08-02Sha1: Update Sha1 to use new functionality in cryptoutil.rsPalmer Cox-101/+37
2013-08-02Crypto: Add overflow checking addition functions.Palmer Cox-55/+71
Added functions to cryptoutil.rs that perform an addition after shifting the 2nd parameter by a specified constant. These function fail!() if integer overflow will result. Updated the Sha2 implementation to use these functions.
2013-08-02Crypto: Add large input tests for all DigestsPalmer Cox-21/+63
Create a helper function in cryptoutil.rs which feeds 1,000,000 'a's into a Digest with varying input sizes and then checks the result. This is essentially the same as one of Sha1's existing tests, so, that test was re-implemented using this method. New tests were added using this method for Sha512 and Sha256.
2013-08-02Crypto: Remove DigestUtil and convert to default methods on the Digest trait.Palmer Cox-30/+23
2013-08-02Sha2: Re-write the Sha2 compression functions to improve performance.Palmer Cox-102/+91
The Sha2 compression functions were re-written to execute the message scheduling calculations in the same loop as the rest of the compression function. The compiler is able to generate much better code. Additionally, innermost part of the compression functions were turned into macros to reduce code duplicate and to make the functions more concise.
2013-08-02Sha2: Create cryptoutil.rs and re-write the Sha2 module to make use of it.Palmer Cox-451/+551
There are 2 main pieces of functionality in cryptoutil.rs: * A set of unsafe function for efficiently reading and writing u32 and u64 values. All of these functions are fairly easy to audit to confirm that they do what they are supposed to. * A FixedBuffer struct. This struct keeps track of input data until there is enough of it to execute the a function on it which expects a fixed block of data. The Sha2 module was rewritten to take advantage of the new functions in cryptoutil as well as FixedBuffer. The result is that the duplicate code for maintaining a buffer of input data is removed from the Sha512 and Sha256 implementation. Additionally, the FixedBuffer code is much more efficient than the previous code was.
2013-08-02Sha2: Remove the result_X() methods; move logic into the Digest impls.Palmer Cox-73/+50
The result_X() methods just calculate an output of a fixed size. They don't really have much to do with running the actually hash algorithm until the very last step - the output. It makes much more sense to put all this logic into the Digest impls for each specific variation on the hash function.
2013-08-02Sha2: Rearrage traits / impls / structs.Palmer Cox-248/+257
The code was arranged so that the core Sha2 code came first, and then all of the various implementation of Digest followed along later. The problem is that the Sha512 compression function code is far away from the Sha512 Digest implementation, so, if you are trying to read over the code, you need to scroll all around the file for no good reason. The code was rearranged so that all of the Sha512 code is in one place and all of the Sha256 code is in another and so that all impls for a struct are near the definition of that struct.
2013-08-02Sha2: Remove unecessary integer type specifications.Palmer Cox-36/+36
2013-08-02(cleanup) Use more do...finally in extra::sync.Ben Blum-207/+102
2013-08-02Add SendDeferred trait and use it to fix #8214.Ben Blum-4/+5
2013-08-02auto merge of #8175 : brson/rust/nodbg, r=graydonbors-81/+0
This stuff is ancient, unused, and tied to oldsched
2013-08-02replace `range` with an external iteratorDaniel Micay-92/+76
2013-08-01auto merge of #8190 : thestinger/rust/for, r=thestingerbors-195/+235
2013-08-01std: Change `Times` trait to use `do` instead of `for`blake2-ppc-40/+42
Change the former repetition:: for 5.times { } to:: do 5.times { } .times() cannot be broken with `break` or `return` anymore; for those cases, use a numerical range loop instead.
2013-08-01std: Remove the internal iterator methods from trait Setblake2-ppc-70/+70
.intersection(), .union() etc methods in trait std::container::Set use internal iters. Remove these methods from the trait. I reported issue #8154 for the reinstatement of iterator-based set algebra methods to the Set trait. For bitv and treemap, that lack Iterator implementations of set operations, preserve them as methods directly on the types themselves. For HashSet, these methods are replaced by the present .union_iter() etc.
2013-08-01extra: Use external iterators in bitv implementationblake2-ppc-33/+55
Convert some internally used functions to use a external iterators. Change all uses of remaining internal iterators to use `do` expr
2013-08-01extra: Replace `for` with `do { .. }` expr where internal iterators are usedblake2-ppc-36/+47
2013-08-01std: Replace `for` with `do { .. }` expr where internal iterators are usedblake2-ppc-4/+6
2013-08-01extra: Use `do` instead of `for` in extra::iterblake2-ppc-19/+22
2013-08-01auto merge of #8164 : brson/rust/noportset, r=pcwaltonbors-4/+0
...haredChan.
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-173/+170
2013-08-01rc: from_{owned,const} -> from_{send,freeze}Daniel Micay-19/+19
2013-08-01make `in` and `foreach` get treated as keywordsDaniel Micay-83/+83
2013-07-31extra: Remove dbg module and rt support codeBrian Anderson-81/+0
This stuff is ancient, unused, and tied to oldsched
2013-07-31std: Remove PortSet. Not supported by new scheduler. Replace uses with ↵Brian Anderson-4/+0
SharedChan.
2013-07-31auto merge of #8139 : brson/rust/rm-old-task-apis, r=pcwaltonbors-1/+1
This removes a bunch of options from the task builder interface that are irrelevant to the new scheduler and were generally unused anyway. It also bumps the stack size of new scheduler tasks so that there's enough room to run rustc and changes the interface to `Thread` to not implicitly join threads on destruction, but instead require an explicit, and mandatory, call to `join`.
2013-07-30auto merge of #8135 : dim-an/rust/master, r=pcwaltonbors-18/+47
Fix std::getopt::opts_str Closes #6492 (std::getopt::opts_str fails for arguments other than the first one).