#[repr(align(64))]pub struct SimdAlignedBuffer<T, const N: usize>{ /* private fields */ }Expand description
Re-export the unified 64-byte aligned buffer type
This type alias maintains backward compatibility while using the consolidated aligned buffer implementation from rusty-common. 64-byte aligned buffer for cache line optimization and false sharing prevention
Aligns data structures to CPU cache line boundaries (typically 64 bytes) to maximize cache efficiency and prevent false sharing in multi-threaded HFT applications.
§Cache Line Benefits
- Cache efficiency: Entire buffer fits within cache line boundaries
- False sharing prevention: Eliminates cache ping-ponging between cores
- Memory bandwidth: Maximizes utilization of cache line transfers
- Prefetching optimization: Predictable access patterns improve prefetcher efficiency
§HFT Use Cases
- Per-thread buffers: Eliminate false sharing between trading threads
- Order book snapshots: Cache-efficient storage of market data
- Statistics collections: High-frequency counter updates
- Message buffers: Network I/O optimization
Implementations§
Source§impl<T, const N: usize> AlignedBuffer64<T, N>
impl<T, const N: usize> AlignedBuffer64<T, N>
Sourcepub fn new() -> AlignedBuffer64<T, N>
pub fn new() -> AlignedBuffer64<T, N>
Create a new 64-byte aligned buffer with all elements initialized to default
Sourcepub const fn with_value(value: T) -> AlignedBuffer64<T, N>
pub const fn with_value(value: T) -> AlignedBuffer64<T, N>
Create a new 64-byte aligned buffer with all elements initialized to the given value
Sourcepub const fn as_mut_slice(&mut self) -> &mut [T]
pub const fn as_mut_slice(&mut self) -> &mut [T]
Get a mutable slice view of the buffer data
Trait Implementations§
Auto Trait Implementations§
impl<T, const N: usize> Freeze for AlignedBuffer64<T, N>where
T: Freeze,
impl<T, const N: usize> RefUnwindSafe for AlignedBuffer64<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for AlignedBuffer64<T, N>where
T: Send,
impl<T, const N: usize> Sync for AlignedBuffer64<T, N>where
T: Sync,
impl<T, const N: usize> Unpin for AlignedBuffer64<T, N>where
T: Unpin,
impl<T, const N: usize> UnwindSafe for AlignedBuffer64<T, N>where
T: UnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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