Skip to main content

MemoryManager

Struct MemoryManager 

Source
pub struct MemoryManager { /* private fields */ }
Expand description

Xila memory manager for tests: every capability is served by System.

Implementations§

Source§

impl MemoryManager

Source

pub const fn new() -> Self

Source

pub fn thread_allocations() -> ThreadAllocations

Snapshot the allocation counters for the calling thread.

Trait Implementations§

Source§

impl Default for MemoryManager

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl ManagerTrait for MemoryManager

Source§

unsafe fn allocate( &self, _: CapabilityFlags, layout: Layout, ) -> Option<NonNull<u8>>

Allocates memory with the specified capabilities and layout. Read more
Source§

unsafe fn deallocate(&self, pointer: NonNull<u8>, layout: Layout)

Deallocates memory previously allocated by this allocator. Read more
Source§

fn get_used(&self) -> usize

Returns the amount of memory currently used in this allocator. Read more
Source§

fn get_free(&self) -> usize

Returns the amount of memory currently available in this allocator. Read more
§

unsafe fn reallocate( &self, capabilities: CapabilityFlags, old_pointer: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Option<NonNull<u8>>

Changes the size or alignment of a previously allocated memory block. Read more
§

fn get_total_size(&self) -> usize

Returns the total size of the memory managed by this allocator. Read more
§

fn flush_instruction_cache(&self, _address: NonNull<u8>, _size: usize)

Flushes the instruction cache for a specific memory region. Read more
§

fn flush_data_cache(&self)

Flushes the data cache to ensure memory coherency. Read more
§

fn get_page_size(&self) -> usize

Returns the page size used by this memory allocator. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.