pub struct CacheAlignedAllocator;Expand description
Cache-aligned memory allocator for high-performance data structures.
Implementations§
Source§impl CacheAlignedAllocator
impl CacheAlignedAllocator
Sourcepub fn allocate<T>(count: usize) -> Option<NonNull<T>>
pub fn allocate<T>(count: usize) -> Option<NonNull<T>>
Allocate cache-aligned memory for optimal performance
Sourcepub unsafe fn deallocate<T>(ptr: NonNull<T>, count: usize)
pub unsafe fn deallocate<T>(ptr: NonNull<T>, count: usize)
Deallocate cache-aligned memory
§Safety
The caller must ensure that:
ptrwas allocated byallocatewith the same type and countptris valid and properly aligned- No other references to the memory exist
- The memory is not accessed after deallocation
Auto Trait Implementations§
impl Freeze for CacheAlignedAllocator
impl RefUnwindSafe for CacheAlignedAllocator
impl Send for CacheAlignedAllocator
impl Sync for CacheAlignedAllocator
impl Unpin for CacheAlignedAllocator
impl UnsafeUnpin for CacheAlignedAllocator
impl UnwindSafe for CacheAlignedAllocator
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