Commit graph

2832 commits

Author SHA1 Message Date
bors
45da2a5f48 auto merge of #8412 : thestinger/rust/vector-add, r=alexcrichton 2013-08-11 04:11:08 -07:00
Daniel Micay
83b3a0eaf1 fix unused imports 2013-08-11 03:17:01 -04:00
Daniel Micay
774c9aebb3 move strdup_uniq lang item to std::str 2013-08-11 03:14:35 -04:00
Daniel Micay
768c9a43ab str: optimize with_capacity
before:

test bench_with_capacity ... bench: 104 ns/iter (+/- 4)

after:

test bench_with_capacity ... bench: 56 ns/iter (+/- 1)
2013-08-11 03:14:35 -04:00
Daniel Micay
2afed31ecc vec: optimize the Add implementation
before:

test add ... bench: 164 ns/iter (+/- 1)

after:

test add ... bench: 113 ns/iter (+/- 2)
2013-08-11 03:14:35 -04:00
Daniel Micay
7db605cd15 disable 64-bit CheckedMul on 32-bit
code generation problem reported as issue #8449
2013-08-11 02:58:52 -04:00
Daniel Micay
076b91f8ad add intrinsics for checked overflow add/sub/mul 2013-08-11 02:51:20 -04:00
bors
eebcff1493 auto merge of #8404 : stepancheg/rust/zero-unit-inline, r=alexcrichton
Follow-up to #8155
2013-08-10 19:53:06 -07:00
Erick Tryzelaar
4e92faad13 Merge branch 'trie-bound-iters' of https://github.com/dim-an/rust into rollup 2013-08-10 13:01:20 -07:00
Erick Tryzelaar
e48ca19bc5 std: fix the non-stage0 str::raw::slice_bytes which broke in a merge 2013-08-10 07:33:22 -07:00
Erick Tryzelaar
6fcf2ee8e3 std: Transform.find_ -> .find 2013-08-10 07:33:22 -07:00
Erick Tryzelaar
f9dee04aaa std: Iterator.len_ -> .len 2013-08-10 07:33:22 -07:00
Erick Tryzelaar
74d2552b0a std: Iterator.last_ -> .last 2013-08-10 07:33:21 -07:00
Erick Tryzelaar
1db62d8311 std: Iterator.chain_ -> .chain 2013-08-10 07:33:21 -07:00
Erick Tryzelaar
60c2661684 std: Iterator.flat_map_ -> .flat_map 2013-08-10 07:33:21 -07:00
Erick Tryzelaar
24d2cd0ef4 std: Iterator.take_ -> .take 2013-08-10 07:33:21 -07:00
Erick Tryzelaar
68f40d215e std: Rename Iterator.transform -> .map
cc #5898
2013-08-10 07:33:21 -07:00
Erick Tryzelaar
4062b84f4a std: merge Iterator and IteratorUtil 2013-08-10 07:02:17 -07:00
Erick Tryzelaar
a6614621af std: merge iterator::DoubleEndedIterator and DoubleEndedIteratorUtil 2013-08-10 07:01:08 -07:00
Erick Tryzelaar
fad7857c7b Mass rename of .consume{,_iter}() to .move_iter()
cc #7887
2013-08-10 07:01:07 -07:00
bors
60f5011005 auto merge of #8296 : erickt/rust/remove-str-trailing-nulls, r=erickt
This PR fixes #7235 and #3371, which removes trailing nulls from `str` types. Instead, it replaces the creation of c strings with a new type, `std::c_str::CString`, which wraps a malloced byte array, and respects:

*  No interior nulls
* Ends with a trailing null
2013-08-09 21:56:17 -07:00
Erick Tryzelaar
ee59aacac4 Merge remote-tracking branch 'remotes/origin/master' into remove-str-trailing-nulls 2013-08-09 18:48:01 -07:00
bors
e81e81f234 auto merge of #8387 : brson/rust/nooldrt, r=brson 2013-08-09 18:41:13 -07:00
Brian Anderson
b75915d0ca Remove the C++ runtime. Sayonara 2013-08-09 16:45:50 -07:00
bors
6f6dce7bbc auto merge of #8176 : catamorphism/rust/rustpkg-extern-mod, r=catamorphism
r? @graydon Also, notably, make rustpkgtest depend on the rustpkg executable (otherwise, tests that shell out to rustpgk might run when rustpkg doesn't exist).
2013-08-09 16:17:10 -07:00
Tim Chevalier
96fd606ddd std/rustc/rustpkg/syntax: Support the extern mod = ... form
This commit allows you to write:

 extern mod x = "a/b/c";

which means rustc will search in the RUST_PATH for a package with
ID a/b/c, and bind it to the name `x` if it's found.

Incidentally, move get_relative_to from back::rpath into std::path
2013-08-09 14:11:50 -07:00
bors
1de201c3c6 auto merge of #8415 : brson/rust/newrt-local-heap-perf, r=pcwalton,brson
Mostly optimizing TLS accesses to bring local heap allocation performance
closer to that of oldsched. It's not completely at parity but removing the
branches involved in supporting oldsched and optimizing pthread_get/setspecific
to instead use our dedicated TCB slot will probably make up for it.
2013-08-09 13:53:08 -07:00
Erick Tryzelaar
c14e14e63a std: more windows fixes to os.rs and run.rs 2013-08-09 11:13:26 -07:00
bors
c20b90647e auto merge of #8369 : yichoi/rust/arm-test, r=sanxiyn
fix some part of test code to pass make check on ARM Android
2013-08-09 10:59:08 -07:00
Dmitry Ermolov
2a2ea5e276 Implement lower_bound_iter/upper_bound_iter for TrieMap/TrieSet 2013-08-09 15:51:49 +04:00
Stepan Koltsov
ae81151ad6 Fix Ipv6Addr to_str for ::1:x.x.x.x addresses
Reported by luqmana@
2013-08-09 13:53:28 +04:00
Brian Anderson
d392556160 std: Fix perf of local allocations in newsched
Mostly optimizing TLS accesses to bring local heap allocation performance
closer to that of oldsched. It's not completely at parity but removing the
branches involved in supporting oldsched and optimizing pthread_get/setspecific
to instead use our dedicated TCB slot will probably make up for it.
2013-08-09 01:15:31 -07:00
OGINO Masanori
b4d6ae5bb8 Remove redundant Ord method impls.
Basically, generic containers should not use the default methods since a
type of elements may not guarantees total order. str could use them
since u8's Ord guarantees total order. Floating point numbers are also
broken with the default methods because of NaN. Thanks for @thestinger.

Timespec also guarantees total order AIUI. I'm unsure whether
extra::semver::Identifier does so I left it alone. Proof needed.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2013-08-09 14:28:14 +09:00
Erick Tryzelaar
56730c094c Merge remote-tracking branch 'remotes/origin/master' into remove-str-trailing-nulls 2013-08-08 19:27:03 -07:00
bors
7a1b61d631 auto merge of #8336 : stepancheg/rust/socket-addr-from-str, r=brson
FromStr implemented from scratch.

It is overengineered a bit, however.

Old implementation handles errors by fail!()-ing. And it has bugs, like it accepts `127.0.0.1::127.0.0.1` as IPv6 address, and does not handle all ipv4-in-ipv6 schemes. So I decided to implement parser from scratch.
2013-08-08 19:08:02 -07:00
bors
936f70bd87 auto merge of #8356 : toddaaro/rust/ws, r=brson
This pull request converts the scheduler from a naive shared queue scheduler to a naive workstealing scheduler. The deque is still a queue inside a lock, but there is still a substantial performance gain. Fiddling with the messaging benchmark I got a ~10x speedup and observed massively reduced memory usage.

There are still *many* locations for optimization, but based on my experience so far it is a clear performance win as it is now.
2013-08-08 16:32:02 -07:00
Stepan Koltsov
b9945f83c9 Add #[inline] to impl Zero for ()
Follow-up to #8155
2013-08-09 02:19:50 +04:00
bors
8f65dbfcfa auto merge of #8385 : cmr/rust/big-rollup, r=alexcrichton
This is a fairly large rollup, but I've tested everything locally, and none of
it should be platform-specific.

r=alexcrichton (bdfdbdd)
r=brson (d803c18)
r=alexcrichton (a5041d0)
r=bstrie (317412a)
r=alexcrichton (135c85e)
r=thestinger (8805baa)
r=pcwalton (0661178)
r=cmr (9397fe0)
r=cmr (caa4135)
r=cmr (6a21d93)
r=cmr (4dc3379)
r=cmr (0aa5154)
r=cmr (18be261)
r=thestinger (f10be03)
2013-08-08 14:32:02 -07:00
toddaaro
af2e03998d Enabled workstealing in the scheduler. Previously we had one global work queue shared by each scheduler. Now there is a separate work queue for each scheduler, and work is "stolen" from other queues when it is exhausted locally. 2013-08-08 14:13:41 -07:00
Erick Tryzelaar
03cc757fe9 std: more fixes for os.rs for windows 2013-08-08 06:37:55 -07:00
bors
a0080f4e07 auto merge of #8245 : alexcrichton/rust/fmt2, r=graydon
This is a reopening of #8182, although this removes any abuse of the compiler internals. Now it's just a pure syntax extension (hard coded what the attribute names are).
2013-08-08 00:22:52 -07:00
Erick Tryzelaar
7a5ee374e2 std: import HANDLE for os::list_dir for windows 2013-08-07 21:07:06 -07:00
Ben Blum
fb1575bcc4 (cleanup) Improve rtabort message for atomic-sleep. 2013-08-07 22:41:15 -04:00
Ben Blum
8ebdb37fd2 fix recv_ready for Port to take &self and not need to return a tuple. Close #8192. 2013-08-07 22:41:15 -04:00
Huon Wilson
8460dac909 std: add missing #[inline] annotation to the f64 arithmetic trait impls. 2013-08-07 22:41:14 -04:00
Jordi Boggiano
403c52d2ae Add weak_rng to get a random algo that puts more emphasis on speed than security 2013-08-07 22:41:14 -04:00
Jordi Boggiano
3db9dc1dfd Document rand module with more emphasis on cryptographic security 2013-08-07 22:41:13 -04:00
Alex Crichton
e99eff172a Forbid priv where it has no effect
This is everywhere except struct fields and enum variants.
2013-08-07 22:41:12 -04:00
Kevin Ballard
8964fcc5ac Implement DoubleEndedIterator on Range
Range is now invertable as long as its element type conforms to Integer.

Remove int::range_rev() et al in favor of range().invert().
2013-08-07 22:41:09 -04:00
blake2-ppc
40bdbf0f5d std: Fix for-range loops that can use iterators
Fix inappropriate for-range loops to use for-iterator constructs (or
other appropriate solution) instead.
2013-08-07 22:39:57 -04:00