diff options
| author | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2014-11-09 17:15:45 +1100 |
|---|---|---|
| committer | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2014-11-13 02:02:44 +1100 |
| commit | d1eb68e8d7d2883c70304021d5443c96bca18abb (patch) | |
| tree | fcbd0118799d497f3b4eeac80dc8881532261447 /src/libarena | |
| parent | 9fe94bd995ab13afab7078a708b01f365740d2cd (diff) | |
Create UnsignedInt trait and deprecate free functions
Diffstat (limited to 'src/libarena')
| -rw-r--r-- | src/libarena/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libarena/lib.rs b/src/libarena/lib.rs index 3e93430eb69..fb091ec7f84 100644 --- a/src/libarena/lib.rs +++ b/src/libarena/lib.rs @@ -38,7 +38,7 @@ use std::cmp; use std::intrinsics::{TyDesc, get_tydesc}; use std::intrinsics; use std::mem; -use std::num; +use std::num::UnsignedInt; use std::ptr; use std::rc::Rc; use std::rt::heap::{allocate, deallocate}; @@ -187,7 +187,7 @@ impl Arena { self.chunks.borrow_mut().push(self.copy_head.borrow().clone()); *self.copy_head.borrow_mut() = - chunk(num::next_power_of_two(new_min_chunk_size + 1u), true); + chunk((new_min_chunk_size + 1u).next_power_of_two(), true); return self.alloc_copy_inner(n_bytes, align); } @@ -228,7 +228,7 @@ impl Arena { self.chunks.borrow_mut().push(self.head.borrow().clone()); *self.head.borrow_mut() = - chunk(num::next_power_of_two(new_min_chunk_size + 1u), false); + chunk((new_min_chunk_size + 1u).next_power_of_two(), false); return self.alloc_noncopy_inner(n_bytes, align); } |
