pub struct MobileMemoryPool { /* private fields */ }Expand description
Mobile memory pool implementation
Implementations§
Source§impl MobileMemoryPool
impl MobileMemoryPool
Sourcepub fn new(config: MemoryPoolConfig) -> Result<Self>
pub fn new(config: MemoryPoolConfig) -> Result<Self>
Create new memory pool
Sourcepub fn allocate(
&self,
size: usize,
alignment: usize,
) -> Result<MemoryAllocation>
pub fn allocate( &self, size: usize, alignment: usize, ) -> Result<MemoryAllocation>
Allocate memory from pool
Sourcepub fn deallocate(&self, allocation: MemoryAllocation) -> Result<()>
pub fn deallocate(&self, allocation: MemoryAllocation) -> Result<()>
Deallocate memory back to pool
Sourcepub fn get_usage_ratio(&self) -> f32
pub fn get_usage_ratio(&self) -> f32
Get memory usage ratio (0.0 to 1.0)
Sourcepub fn get_available_memory(&self) -> usize
pub fn get_available_memory(&self) -> usize
Get available memory in bytes
Sourcepub fn get_peak_usage(&self) -> usize
pub fn get_peak_usage(&self) -> usize
Get peak memory usage in bytes
Trait Implementations§
Source§impl Clone for MobileMemoryPool
impl Clone for MobileMemoryPool
Auto Trait Implementations§
impl Freeze for MobileMemoryPool
impl RefUnwindSafe for MobileMemoryPool
impl Send for MobileMemoryPool
impl Sync for MobileMemoryPool
impl Unpin for MobileMemoryPool
impl UnsafeUnpin for MobileMemoryPool
impl UnwindSafe for MobileMemoryPool
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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