Struct OverflowAllocator

Source
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

Source

pub fn new( block_allocator: *mut BlockAllocator, bitmap: *const SpaceBitmap<comet::::allocator::overflow::{impl#0}::new::{constant#0}>, ) -> OverflowAllocator

Create a new OverflowAllocator backed by the given BlockAllocator.

Trait Implementations§

Source§

impl Allocator for OverflowAllocator

Source§

fn line_bitmap( &self, ) -> &SpaceBitmap<comet::::allocator::overflow::{impl#1}::line_bitmap::{constant#0}>

Source§

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)>

Get the current block to allocate from.
Source§

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)>

Get a new block from a block resource.
Source§

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)

Callback if the given block has no holes left.
Source§

fn allocate(&mut self, size: usize) -> Option<*mut HeapObjectHeader>

Allocate an object of size bytes or return None. Read more
Source§

fn scan_for_hole( &mut self, size: usize, block_tuple: (*mut Block, u16, u16), ) -> Option<(*mut Block, u16, u16)>

Scan a block tuple for a hole of size bytes and return a matching hole. Read more
Source§

fn allocate_from_block( &self, size: usize, block_tuple: (*mut Block, u16, u16), ) -> ((*mut Block, u16, u16), *mut HeapObjectHeader)

Allocate an uninitialized object of size bytes from the block tuple. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Any for T
where T: Any,

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.