Tim Chevalier
|
5da4b4d928
|
std/extra: changing XXX to FIXME; cleanup
* Get rid of by-value-self workarounds; it works now
* Remove type annotations, they're not needed anymore
|
2013-08-21 17:17:41 -07:00 |
|
Niko Matsakis
|
0479d946c8
|
Add externfn macro and correctly label fixed_stack_segments
|
2013-08-19 07:13:15 -04:00 |
|
Daniel Micay
|
1008945528
|
remove obsolete foreach keyword
this has been replaced by `for`
|
2013-08-03 22:48:02 -04:00 |
|
Daniel Micay
|
234acad404
|
replace range with an external iterator
|
2013-08-02 00:51:14 -04:00 |
|
Daniel Micay
|
ef870d37a5
|
implement pointer arithmetic with GEP
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-30 02:50:31 -04:00 |
|
Daniel Micay
|
4a2d22bdb1
|
fix compilation on macos/windows
|
2013-07-24 09:45:21 -04:00 |
|
Brian Anderson
|
6c88e46d4d
|
std:rt: args module is not used by win/mac. #7951
|
2013-07-24 09:45:20 -04:00 |
|
Brian Anderson
|
1b7c99655f
|
std::rt: Support os::args
|
2013-06-21 14:42:15 -07:00 |
|