pub struct UsmAllocator<'a, T: UsmAllocatorKind> { /* private fields */ }Expand description
An instance of a USM allocator.
Trait Implementations§
Source§impl<T: UsmAllocatorKind> Allocator for UsmAllocator<'_, T>
impl<T: UsmAllocatorKind> Allocator for UsmAllocator<'_, T>
Source§fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
Attempts to allocate a block of memory. Read more
Source§unsafe fn deallocate(&self, ptr: NonNull<u8>, _layout: Layout)
unsafe fn deallocate(&self, ptr: NonNull<u8>, _layout: Layout)
Deallocates the memory referenced by
ptr. Read more§fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
Behaves like
allocate, but also ensures that the returned memory is zero-initialized. Read more§unsafe fn grow(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
Attempts to extend the memory block. Read more
§unsafe fn grow_zeroed(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError>
unsafe fn grow_zeroed( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
Behaves like
grow, but also ensures that the new contents are set to zero before being
returned. Read moreSource§impl<'a, T: UsmAllocatorKind> From<&'a Queue> for UsmAllocator<'a, T>
impl<'a, T: UsmAllocatorKind> From<&'a Queue> for UsmAllocator<'a, T>
impl<'a, T: UsmAllocatorKind> UsmAlloc for UsmAllocator<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for UsmAllocator<'a, T>
impl<'a, T> RefUnwindSafe for UsmAllocator<'a, T>where
T: RefUnwindSafe,
impl<'a, T> !Send for UsmAllocator<'a, T>
impl<'a, T> !Sync for UsmAllocator<'a, T>
impl<'a, T> Unpin for UsmAllocator<'a, T>where
T: Unpin,
impl<'a, T> UnsafeUnpin for UsmAllocator<'a, T>
impl<'a, T> UnwindSafe for UsmAllocator<'a, T>where
T: UnwindSafe,
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