mozilla/rust — pull request #7682 by thestinger (2013-07-10 02:25:59+00:00)
Title: vec::with_capacity: do one alloc for non-managed

```rust
extern mod extra;

use std::vec;

#[bench]
fn bench_set_memory(b: &mut extra::test::BenchHarness) {
do b.iter {
let _v: ~[u8] = vec::with_capacity(1024);
}
}
```

Before:

`test bench_set_memory ... bench: 293 ns/iter (+/- 0)`

After:

`test bench_set_memory ... bench: 125 ns/iter (+/- 3)`