pub struct OverflowAllocator { /* private fields */ }Expand description
The OverflowAllocator is used to allocate medium sized objects
(objects of at least MEDIUM_OBJECT bytes size) within the immix space to
limit fragmentation in the NormalAllocator.
Implementations§
Source§impl OverflowAllocator
impl OverflowAllocator
Sourcepub fn new(
block_allocator: *mut BlockAllocator,
bitmap: *const SpaceBitmap<LINE_SIZE>,
) -> OverflowAllocator
pub fn new( block_allocator: *mut BlockAllocator, bitmap: *const SpaceBitmap<LINE_SIZE>, ) -> OverflowAllocator
Create a new OverflowAllocator backed by the given BlockAllocator.
Trait Implementations§
Source§impl Allocator for OverflowAllocator
impl Allocator for OverflowAllocator
fn line_bitmap(&self) -> &SpaceBitmap<LINE_SIZE>
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.
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 OverflowAllocator
impl !RefUnwindSafe for OverflowAllocator
impl !Send for OverflowAllocator
impl !Sync for OverflowAllocator
impl Unpin for OverflowAllocator
impl UnsafeUnpin for OverflowAllocator
impl !UnwindSafe for OverflowAllocator
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