pub struct NumaAllocator { /* private fields */ }Expand description
NUMA-aware allocator.
Implementations§
Source§impl NumaAllocator
impl NumaAllocator
Sourcepub fn new() -> NumaResult<Self>
pub fn new() -> NumaResult<Self>
Create a new NUMA allocator.
Sourcepub fn with_topology(topology: NumaTopology) -> NumaResult<Self>
pub fn with_topology(topology: NumaTopology) -> NumaResult<Self>
Create with specific topology.
Sourcepub fn allocate_on_node(
&self,
size: usize,
node: NumaNode,
) -> NumaResult<NumaBuffer>
pub fn allocate_on_node( &self, size: usize, node: NumaNode, ) -> NumaResult<NumaBuffer>
Allocate memory on a specific NUMA node.
Sourcepub fn allocate(&self, size: usize) -> NumaResult<NumaBuffer>
pub fn allocate(&self, size: usize) -> NumaResult<NumaBuffer>
Allocate without node preference.
Sourcepub fn prefault(&self, buffer: &mut NumaBuffer)
pub fn prefault(&self, buffer: &mut NumaBuffer)
Pre-fault pages to materialize allocation.
This ensures pages are actually allocated in physical memory on the intended NUMA node before use.
Sourcepub fn topology(&self) -> &NumaTopology
pub fn topology(&self) -> &NumaTopology
Get NUMA topology.
Sourcepub fn total_allocated(&self) -> usize
pub fn total_allocated(&self) -> usize
Get total bytes allocated.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for NumaAllocator
impl RefUnwindSafe for NumaAllocator
impl Send for NumaAllocator
impl Sync for NumaAllocator
impl Unpin for NumaAllocator
impl UnsafeUnpin for NumaAllocator
impl UnwindSafe for NumaAllocator
Blanket Implementations§
impl<T> Allocation for T
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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