stdlib: Actually increase arena chunk sizes by powers of two

This commit is contained in:
Patrick Walton 2012-03-28 22:22:50 -07:00
parent b210c7ad97
commit 166d14e42d

View File

@ -27,7 +27,7 @@ impl arena for arena {
let mut head = list::head(self.chunks);
let chunk_size = vec::alloc_len(head.data);
let new_min_chunk_size = uint::max(n_bytes, chunk_size);
head = chunk(uint::next_power_of_two(new_min_chunk_size));
head = chunk(uint::next_power_of_two(new_min_chunk_size + 1u));
self.chunks = list::cons(head, @self.chunks);
ret self.alloc(n_bytes, align);