Struct zallocator::Zallocator
source · [−]pub struct Zallocator { /* private fields */ }
Expand description
Amortizes the cost of small allocations by allocating memory in bigger chunks.
Implementations
sourceimpl Zallocator
impl Zallocator
sourcepub fn new(size: usize, tag: &'static str) -> Result<Self>
pub fn new(size: usize, tag: &'static str) -> Result<Self>
Creates an allocator starting with the given size.
sourcepub fn allocate_aligned(&self, size: u64) -> Result<Buffer>
pub fn allocate_aligned(&self, size: u64) -> Result<Buffer>
Allocate a buffer with according to size
(well-aligned)
sourcepub fn allocate_aligned_unchecked(&self, size: u64) -> Buffer
pub fn allocate_aligned_unchecked(&self, size: u64) -> Buffer
Allocate a buffer with according to size
(well-aligned) without checking size
Panics
Size larger than 1 << 30
.
sourcepub fn allocate_unchecked(&self, size: u64) -> Buffer
pub fn allocate_unchecked(&self, size: u64) -> Buffer
Trait Implementations
sourceimpl Clone for Zallocator
impl Clone for Zallocator
sourcefn clone(&self) -> Zallocator
fn clone(&self) -> Zallocator
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Zallocator
impl Debug for Zallocator
Auto Trait Implementations
impl !RefUnwindSafe for Zallocator
impl Send for Zallocator
impl Sync for Zallocator
impl Unpin for Zallocator
impl !UnwindSafe for Zallocator
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more