pub struct Allocator;
Expand description
Allocator which uses the UEFI pool allocation functions.
Only valid for as long as the UEFI boot services are available.
Trait Implementations§
source§impl GlobalAlloc for Allocator
impl GlobalAlloc for Allocator
source§unsafe fn alloc(&self, layout: Layout) -> *mut u8
unsafe fn alloc(&self, layout: Layout) -> *mut u8
Allocate memory using BootServices::allocate_pool
. The allocation is
of type MemoryType::LOADER_DATA
for UEFI applications, MemoryType::BOOT_SERVICES_DATA
for UEFI boot drivers and MemoryType::RUNTIME_SERVICES_DATA
for UEFI runtime drivers.
source§unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout)
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout)
Deallocate memory using BootServices::free_pool
.
Auto Trait Implementations§
impl Freeze for Allocator
impl RefUnwindSafe for Allocator
impl Send for Allocator
impl Sync for Allocator
impl Unpin for Allocator
impl UnwindSafe for Allocator
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