Skip to main content

AllocPolicy4096

Struct AllocPolicy4096 

Source
pub struct AllocPolicy4096;
Expand description

Entity allocation policy for chunks of size 4096.

Trait Implementations§

Source§

impl IAllocPolicy for AllocPolicy4096

Source§

const CHUNK_SIZE_LOG2: usize = 12

Chunk size log2 (e.g., 7 for 128, 8 for 256, etc.)
Source§

const CHUNK_SIZE: usize

Chunk size (e.g., 128, 256, etc.)
Source§

const BITSET_LEN: usize

Bitset length (number of u64 units in the bitset)
Source§

const UNIT_ID_MASK: usize

Unit ID mask, usually CHUNK_SIZE - 1
Source§

type BitAlloc = SummaryAlloc<64>

Bit allocator type. MTB::Entity chooses different bit allocators for different chunk sizes.
Source§

type Units<E> = [Unit<E>; 4096]

Unit array type for the chunk.
Source§

fn compose(chunk: u32, unit: u16, generation: u16) -> GenIndex

Compose a GenIndex from chunk ID, unit ID, and generation.
Source§

fn chunk(index: GenIndex) -> u32

Extract chunk ID from a GenIndex.
Source§

fn unit(index: GenIndex) -> u16

Extract unit ID from a GenIndex.
Source§

fn tear(index: GenIndex) -> (u32, u16, u16)

Tear down a GenIndex into chunk ID, unit ID, and generation.

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