pub struct AlignmentConfig {
pub cache_line_size: usize,
pub vector_size: usize,
pub page_size: usize,
pub use_huge_pages: bool,
}Expand description
Memory alignment configuration for optimal cache performance.
Fields§
§cache_line_size: usizeCache line size (typically 64 bytes)
vector_size: usizeVector register size (typically 32 bytes for AVX2, 64 for AVX-512)
page_size: usizePage size for large allocations (typically 4KB)
use_huge_pages: boolEnable huge pages for large allocations
Implementations§
Source§impl AlignmentConfig
impl AlignmentConfig
Sourcepub fn with_huge_pages() -> Self
pub fn with_huge_pages() -> Self
Creates configuration with huge pages enabled.
Sourcepub fn alignment_for_size(&self, size: usize) -> usize
pub fn alignment_for_size(&self, size: usize) -> usize
Gets the alignment requirement for the given size.
Trait Implementations§
Source§impl Clone for AlignmentConfig
impl Clone for AlignmentConfig
Source§fn clone(&self) -> AlignmentConfig
fn clone(&self) -> AlignmentConfig
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 moreSource§impl Debug for AlignmentConfig
impl Debug for AlignmentConfig
Source§impl Default for AlignmentConfig
impl Default for AlignmentConfig
impl Copy for AlignmentConfig
Auto Trait Implementations§
impl Freeze for AlignmentConfig
impl RefUnwindSafe for AlignmentConfig
impl Send for AlignmentConfig
impl Sync for AlignmentConfig
impl Unpin for AlignmentConfig
impl UnwindSafe for AlignmentConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more