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<LINE_SIZE>,
) -> NormalAllocator
pub fn new( block_allocator: *mut BlockAllocator, bitmap: *const SpaceBitmap<LINE_SIZE>, ) -> 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<BlockTuple>
fn take_current_block(&mut self) -> Option<BlockTuple>
Get the current block to allocate from.
Source§fn put_current_block(&mut self, block_tuple: BlockTuple)
fn put_current_block(&mut self, block_tuple: BlockTuple)
Set the current block to allocate from.
Source§fn get_new_block(&mut self) -> Option<BlockTuple>
fn get_new_block(&mut self) -> Option<BlockTuple>
Get a new block from a block resource.
fn line_bitmap(&self) -> &SpaceBitmap<LINE_SIZE>
Source§fn handle_no_hole(&mut self, size: usize) -> Option<BlockTuple>
fn handle_no_hole(&mut self, size: usize) -> Option<BlockTuple>
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.Source§fn scan_for_hole(
&mut self,
size: usize,
block_tuple: BlockTuple,
) -> Option<BlockTuple>
fn scan_for_hole( &mut self, size: usize, block_tuple: BlockTuple, ) -> Option<BlockTuple>
Scan a block tuple for a hole of
size bytes and return a matching
hole. Read moreSource§fn allocate_from_block(
&self,
size: usize,
block_tuple: BlockTuple,
) -> (BlockTuple, *mut HeapObjectHeader)
fn allocate_from_block( &self, size: usize, block_tuple: BlockTuple, ) -> (BlockTuple, *mut HeapObjectHeader)
Allocate an uninitialized object of
size bytes from the block tuple. Read moreAuto 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