pub struct LayoutOptimizer { /* private fields */ }
Expand description
Memory layout optimizer
Implementations§
Source§impl LayoutOptimizer
impl LayoutOptimizer
Sourcepub fn calculate_alignment<T>(&self) -> usize
pub fn calculate_alignment<T>(&self) -> usize
Calculate optimal alignment for a type
Sourcepub fn calculate_padding(&self, size: usize, alignment: usize) -> usize
pub fn calculate_padding(&self, size: usize, alignment: usize) -> usize
Calculate padding needed for alignment
Sourcepub fn is_cache_friendly<T>(&self, data: &[T]) -> bool
pub fn is_cache_friendly<T>(&self, data: &[T]) -> bool
Check if layout is cache-friendly
Trait Implementations§
Source§impl Clone for LayoutOptimizer
impl Clone for LayoutOptimizer
Source§fn clone(&self) -> LayoutOptimizer
fn clone(&self) -> LayoutOptimizer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for LayoutOptimizer
impl RefUnwindSafe for LayoutOptimizer
impl Send for LayoutOptimizer
impl Sync for LayoutOptimizer
impl Unpin for LayoutOptimizer
impl UnwindSafe for LayoutOptimizer
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