pub struct Manager(/* private fields */);
Expand description
A wrapper type that adapts any type implementing Allocator_trait
to the standard
Rust GlobalAlloc
trait.
This enables custom allocators that implement the Xila-specific Allocator_trait
to be used as the global memory allocator for Rust’s allocation system.
Implementations§
Trait Implementations§
Source§impl GlobalAlloc for Manager
Implementation of the standard library’s GlobalAlloc
trait for any wrapped
type that implements Allocator_trait
.
impl GlobalAlloc for Manager
Implementation of the standard library’s GlobalAlloc
trait for any wrapped
type that implements Allocator_trait
.
This implementation delegates the standard allocation operations to the wrapped allocator’s methods, converting between Rust’s and Xila’s allocation types.
§Safety
The implementation upholds the safety guarantees required by GlobalAlloc
:
- Memory is properly aligned according to the layout
- Deallocation uses the same layout that was used for allocation
Source§unsafe fn alloc(&self, layout: Layout) -> *mut u8
unsafe fn alloc(&self, layout: Layout) -> *mut u8
Allocates memory as described by the given
layout
. Read moreAuto Trait Implementations§
impl Freeze for Manager
impl !RefUnwindSafe for Manager
impl Send for Manager
impl Sync for Manager
impl Unpin for Manager
impl !UnwindSafe for Manager
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