pub struct NormalAllocator { /* private fields */ }
Expand description
The NormalAllocator
is the standard allocator to allocate objects within
the immix space.
Objects smaller than MEDIUM_OBJECT
bytes are
Implementations§
Source§impl NormalAllocator
impl NormalAllocator
Sourcepub fn new(
block_allocator: *mut BlockAllocator,
bitmap: *const SpaceBitmap<comet::::allocator::normal::{impl#0}::new::{constant#0}>,
) -> NormalAllocator
pub fn new( block_allocator: *mut BlockAllocator, bitmap: *const SpaceBitmap<comet::::allocator::normal::{impl#0}::new::{constant#0}>, ) -> NormalAllocator
Create a new NormalAllocator
backed by the given BlockAllocator
.
Sourcepub fn set_recyclable_blocks(&mut self, blocks: BlockList)
pub fn set_recyclable_blocks(&mut self, blocks: BlockList)
Set the recyclable blocks.
Trait Implementations§
Source§impl Allocator for NormalAllocator
impl Allocator for NormalAllocator
Source§fn get_all_blocks(&mut self, list: &mut BlockList)
fn get_all_blocks(&mut self, list: &mut BlockList)
Get all block managed by the allocator, draining any local
collections.
Source§fn take_current_block(&mut self) -> Option<(*mut Block, u16, u16)>
fn take_current_block(&mut self) -> Option<(*mut Block, u16, u16)>
Get the current block to allocate from.
Source§fn put_current_block(&mut self, block_tuple: (*mut Block, u16, u16))
fn put_current_block(&mut self, block_tuple: (*mut Block, u16, u16))
Set the current block to allocate from.
Source§fn get_new_block(&mut self) -> Option<(*mut Block, u16, u16)>
fn get_new_block(&mut self) -> Option<(*mut Block, u16, u16)>
Get a new block from a block resource.
fn line_bitmap( &self, ) -> &SpaceBitmap<comet::::allocator::normal::{impl#1}::line_bitmap::{constant#0}>
Source§fn handle_no_hole(&mut self, size: usize) -> Option<(*mut Block, u16, u16)>
fn handle_no_hole(&mut self, size: usize) -> Option<(*mut Block, u16, u16)>
Callback if no hole of
size
bytes was found in the current block.Source§fn handle_full_block(&mut self, block: *mut Block)
fn handle_full_block(&mut self, block: *mut Block)
Callback if the given
block
has no holes left.Auto Trait Implementations§
impl Freeze for NormalAllocator
impl !RefUnwindSafe for NormalAllocator
impl !Send for NormalAllocator
impl !Sync for NormalAllocator
impl Unpin for NormalAllocator
impl !UnwindSafe for NormalAllocator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more