rustc: Don't zero out arena chunks with vec::from_elem; that's slow because it calls the glue.
This commit is contained in:
parent
2663018792
commit
5ce3d35f41
1 changed files with 3 additions and 1 deletions
|
|
@ -8,7 +8,9 @@ type chunk = {data: [u8], mut fill: uint};
|
|||
type arena = {mut chunks: list::list<@chunk>};
|
||||
|
||||
fn chunk(size: uint) -> @chunk {
|
||||
@{ data: vec::from_elem(size, 0u8), mut fill: 0u }
|
||||
let mut v = [];
|
||||
vec::reserve(v, size);
|
||||
@{ data: v, mut fill: 0u }
|
||||
}
|
||||
|
||||
fn arena_with_size(initial_size: uint) -> arena {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue