pub struct MemoryManager { /* private fields */ }Expand description
Xila memory manager for tests: every capability is served by System.
Implementations§
Source§impl MemoryManager
impl MemoryManager
pub const fn new() -> MemoryManager
Sourcepub fn thread_allocations() -> ThreadAllocations
pub fn thread_allocations() -> ThreadAllocations
Snapshot the allocation counters for the calling thread.
Trait Implementations§
Source§impl Default for MemoryManager
impl Default for MemoryManager
Source§fn default() -> MemoryManager
fn default() -> MemoryManager
Returns the “default value” for a type. Read more
Source§impl ManagerTrait for MemoryManager
impl ManagerTrait for MemoryManager
Source§unsafe fn allocate(
&self,
_: CapabilityFlags,
layout: Layout,
) -> Option<NonNull<u8>>
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)
unsafe fn deallocate(&self, pointer: NonNull<u8>, layout: Layout)
Deallocates memory previously allocated by this allocator. Read more
Source§fn get_used(&self) -> usize
fn get_used(&self) -> usize
Returns the amount of memory currently used in this allocator. Read more
Source§fn get_free(&self) -> usize
fn get_free(&self) -> usize
Returns the amount of memory currently available in this allocator. Read more
Source§unsafe fn reallocate(
&self,
capabilities: CapabilityFlags,
old_pointer: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Option<NonNull<u8>>
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
Source§fn get_total_size(&self) -> usize
fn get_total_size(&self) -> usize
Returns the total size of the memory managed by this allocator. Read more
Source§fn flush_instruction_cache(&self, _address: NonNull<u8>, _size: usize)
fn flush_instruction_cache(&self, _address: NonNull<u8>, _size: usize)
Flushes the instruction cache for a specific memory region. Read more
Source§fn flush_data_cache(&self)
fn flush_data_cache(&self)
Flushes the data cache to ensure memory coherency. Read more
Source§fn get_page_size(&self) -> usize
fn get_page_size(&self) -> usize
Returns the page size used by this memory allocator. Read more
Auto Trait Implementations§
impl !Freeze for MemoryManager
impl RefUnwindSafe for MemoryManager
impl Send for MemoryManager
impl Sync for MemoryManager
impl Unpin for MemoryManager
impl UnsafeUnpin for MemoryManager
impl UnwindSafe for MemoryManager
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