Commit graph

24115 commits

Author SHA1 Message Date
Palmer Cox
2a8dfc3f22 Implement DoubleEndedIterator for MutChunkIter. 2013-11-30 19:54:28 -05:00
Palmer Cox
f2a01ea277 Implement mut_chunks() method for MutableVector trait.
mut_chunks() returns an iterator that produces mutable slices. This is the
mutable version of the existing chunks() method on the ImmutableVector trait.
2013-11-30 19:07:56 -05:00
bors
dfe46f788b auto merge of #10737 : huonw/rust/with-cap, r=alexcrichton
This allows one to reduce the number of reallocs of the internal buffer
if one has an approximate idea of the size of the final output.
2013-11-30 09:56:41 -08:00
bors
9bf62f71bc auto merge of #10727 : erickt/rust/json, r=huonw
This PR does some small modernizations to the json library. First is to remove the `@` boxes, second is to rename the constructors to `new`.
2013-11-30 06:06:42 -08:00
Huon Wilson
be6ae6eb37 std::io::mem: add a with_capacity constructor to MemWriter.
This allows one to reduce the number of reallocs of the internal buffer
if one has an approximate idea of the size of the final output.
2013-12-01 00:58:27 +11:00
bors
eeaf2e1ddc auto merge of #10735 : alexcrichton/rust/issue-10734, r=cmr
Turns out `with_scope` already translates destructors, so by manually
translating destructors we end up running them all twice (bad).

Closes #10734
2013-11-30 04:01:45 -08:00
bors
156054f55c auto merge of #10722 : cmr/rust/type_id_opaque, r=alexcrichton
Closes #10594
2013-11-30 01:21:41 -08:00
Alex Crichton
7bb166ef4f Don't run cleanups twice in "if true" blocks
Turns out `with_scope` already translates destructors, so by manually
translating destructors we end up running them all twice (bad).

Closes #10734
2013-11-30 00:30:28 -08:00
Corey Richardson
572635b76f Wrap the return value of the type_id intrinsic in an opaque box
Closes #10594
2013-11-30 02:58:36 -05:00
Erick Tryzelaar
a7b311ac61 extra: missed a couple @ in json 2013-11-29 21:26:03 -08:00
bors
80991bb578 auto merge of #10719 : Kimundi/rust/switch_to_multi_item_macros, r=alexcrichton
- 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-29 14:01:48 -08:00
bors
dd1184eedb auto merge of #10678 : alexcrichton/rust/issue-4877, r=pcwalton
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-29 12:31:49 -08:00
Alex Crichton
a70f9d7324 Implement a lock-free work-stealing deque
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-29 12:19:16 -08:00
Marvin Löbel
4840064f85 Removed module macro workaround for signed and unsigned integers 2013-11-29 20:36:47 +01:00
Marvin Löbel
0d8ace823b Removed useless cmp::{min, max} reexports from the integer modules 2013-11-29 20:19:22 +01:00
Erick Tryzelaar
6818b96a66 extra: json::Encoder should take a &mut io::Writer 2013-11-29 11:19:19 -08:00
Erick Tryzelaar
f7b739c34c extra: Rename json constructors into *::init 2013-11-29 11:19:19 -08:00
Erick Tryzelaar
5b41df4ca0 Remove some unnecessary impls from json 2013-11-29 11:19:18 -08:00
Erick Tryzelaar
18ca312984 Remove @ from json::Error 2013-11-29 11:19:18 -08:00
bors
08f4d1ff9f auto merge of #10697 : pcwalton/rust/path-new, r=pcwalton
r+

(carrying over from @alexcrichton's review)
2013-11-29 11:01:50 -08:00
Patrick Walton
c54427ddfb libstd: Change Path::new to Path::init. 2013-11-29 10:55:13 -08:00
bors
631cbd2e11 auto merge of #10726 : pnkfelix/rust/fsk-remove-at-fn-artifact, r=thestinger
While tracking down how this function became dead, identified a spot
(@fn cannot happen) where we probably would prefer to ICE rather than
pass silently; so added fail! invocation.
2013-11-29 09:36:40 -08:00
Felix S. Klock II
fffa10c175 Removed some dead code.
While tracking down how this function became dead, identified a spot
(@fn cannot happen) where we probably would prefer to ICE rather than
pass silently; so added fail! invocation.
2013-11-29 18:20:27 +01:00
Marvin Löbel
90f9eb3b1e Removed a few macro-expanding-to-module workarounds
Also documented a few issues
2013-11-29 17:33:36 +01:00
bors
6c672ee094 auto merge of #10715 : alexcrichton/rust/fix-log-twice, r=huonw
It may mislead you into thinking tasks are spawning twice, when in fact they are
not.
2013-11-29 01:31:47 -08:00
Alex Crichton
bfba120133 Fix initial debug statements printing twice
It may mislead you into thinking tasks are spawning twice, when in fact they are
not.
2013-11-28 23:46:22 -08:00
bors
bf6964ecb6 auto merge of #10709 : alexcrichton/rust/snapshot, r=pcwalton 2013-11-28 20:31:39 -08:00
Alex Crichton
ab387a6838 Register new snapshots 2013-11-28 20:27:56 -08:00
bors
90d06ecf6b auto merge of #10704 : TeXitoi/rust/spectralnorm-resurected, r=alexcrichton 2013-11-28 12:26:31 -08:00
Guillaume Pinot
6bd22494e9 shootout-spectralnorm resurection with parallelization 2013-11-28 20:46:59 +01:00
bors
859c3baf64 auto merge of #10519 : nikomatsakis/rust/issue-8624-borrowck-overly-permissive, r=pnkfelix
See #8624 for details.

r? @pnkfelix
2013-11-28 03:51:32 -08:00
Niko Matsakis
09e12fa553 Test that reborrowing contents of an &'a mut &'b mut pointer can only
be done for at most lifetime `'a`

Fixes #8624
2013-11-28 06:43:39 -05:00
Niko Matsakis
bc4164d4c0 Modify iterators to make them safe with the new rules. 2013-11-28 06:43:39 -05:00
bors
42ea44ba27 auto merge of #10694 : klutzy/rust/rustdoc-closure, r=alexcrichton 2013-11-27 21:02:52 -08:00
bors
68e3292fd7 auto merge of #10691 : g3xzh/rust/benchm, r=cmr
I have written some benchmark tests to `push`, `push_many`, `join`,
`join_many` and `ends_with_path`.

Let me know what you think (@cmr).
Thanks in advance.
2013-11-27 19:47:15 -08:00
bors
db5b51ae63 auto merge of #10687 : alexcrichton/rust/issue-10686, r=thestinger
Turns out android doesn't support LLVM's thread_local attribute and accompanying
implementation.

Closes #10686
2013-11-27 18:32:30 -08:00
bors
503e5df3f2 auto merge of #10621 : Florob/rust/unicode63, r=cmr
This update the unicode.rs file to the latest Unicode version released 2013-09-30.
2013-11-27 16:47:14 -08:00
bors
d2c405eeff auto merge of #10642 : cmr/rust/strict_doccomment, r=alexcrichton
Previously, `//// foo` and `/*** foo ***/` were accepted as doc comments. This
changes that, so that only `/// foo` and `/** foo ***/` are accepted. This
confuses many newcomers and it seems weird.

Also update the manual for these changes, and modernify the EBNF for comments.

Closes #10638
2013-11-27 15:32:18 -08:00
Corey Richardson
b50b162884 Be more strict about doc comments
Previously, `//// foo` and `/*** foo ***/` were accepted as doc comments. This
changes that, so that only `/// foo` and `/** foo ***/` are accepted. This
confuses many newcomers and it seems weird.

Also update the manual for these changes, and modernify the EBNF for comments.

Closes #10638
2013-11-27 18:00:50 -05:00
Florian Zeitz
dfe38dbca4 Fix handling of upper/lowercase, and whitespace 2013-11-27 23:36:20 +01:00
Florian Zeitz
c234614950 Update Unicode data to version 6.3 2013-11-27 23:25:19 +01:00
Florian Zeitz
e9ab9bf01a Update unicode.py to reflect language changes 2013-11-27 23:21:22 +01:00
bors
d662820b29 auto merge of #10680 : alexcrichton/rust/relax-feature-gate, r=thestinger
Instead of forcibly always aborting compilation, allow usage of
 #[warn(unknown_features)] and related lint attributes to selectively abort
 compilation. By default, this lint is deny.
2013-11-27 14:17:41 -08:00
Alex Crichton
1686bfabf5 Use the native tls implementation on android
Turns out android doesn't support LLVM's thread_local attribute and accompanying
implementation.

Closes #10686
2013-11-27 11:56:43 -08:00
bors
e147a090a5 auto merge of #10685 : ebiggers/rust/ascii_fixes, r=alexcrichton
is_digit() incorrectly returned false for '0'.
is_control() incorrectly returned true for ' ' (space).
2013-11-27 11:52:09 -08:00
bors
e4136bd552 auto merge of #10662 : alexcrichton/rust/thread-detach, r=pcwalton
This has one commit from a separate pull request (because these commits depend on that one), but otherwise the extra details can be found in the commit messages. The `rt::thread` module has been generally cleaned up for everyday safe usage (and it's a bug if it's not safe).
2013-11-27 09:57:05 -08:00
Alex Crichton
a9bd049fc0 Relax restrictions on unknown feature directives
Instead of forcibly always aborting compilation, allow usage of
 #[warn(unknown_features)] and related lint attributes to selectively abort
 compilation. By default, this lint is deny.
2013-11-27 09:54:30 -08:00
Alex Crichton
5d6dbf3f26 Improve the rt::thread module
* 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-27 09:53:48 -08:00
klutzy
79ed898f64 rustdoc: Use new ||/proc syntax 2013-11-28 02:27:04 +09:00
bors
a6fc577ab5 auto merge of #10693 : eddyb/rust/freeze-ast, r=thestinger
It's truly immutable now, which will allow us to remove some cloning in the parser and box parts of the AST in `Rc<T>` (if desired).
2013-11-27 08:07:56 -08:00