pub struct BufferPoolAllocator<P: BufferRetentionPolicy, const ALIGNMENT: usize, R, A: Allocator + Clone> { /* private fields */ }Trait Implementations§
Source§impl<P: BufferRetentionPolicy, const ALIGNMENT: usize, R: WeakAlignedBufferPoolRef<P, ALIGNMENT, A>, A: Allocator + Clone> Allocator for BufferPoolAllocator<P, ALIGNMENT, R, A>
impl<P: BufferRetentionPolicy, const ALIGNMENT: usize, R: WeakAlignedBufferPoolRef<P, ALIGNMENT, A>, A: Allocator + Clone> Allocator for BufferPoolAllocator<P, ALIGNMENT, R, A>
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§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 moreSource§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 moreSource§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
Source§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<P: BufferRetentionPolicy, const ALIGNMENT: usize, R: WeakAlignedBufferPoolRef<P, ALIGNMENT, A>, A: Allocator + Clone> BufferAllocator<ALIGNMENT> for BufferPoolAllocator<P, ALIGNMENT, R, A>
impl<P: BufferRetentionPolicy, const ALIGNMENT: usize, R: WeakAlignedBufferPoolRef<P, ALIGNMENT, A>, A: Allocator + Clone> BufferAllocator<ALIGNMENT> for BufferPoolAllocator<P, ALIGNMENT, R, A>
Source§unsafe fn deallocate_buffer(&self, raw: RawBuffer<ALIGNMENT>)
unsafe fn deallocate_buffer(&self, raw: RawBuffer<ALIGNMENT>)
Deallocates the buffer. Read more
Source§impl<P: BufferRetentionPolicy, const ALIGNMENT: usize, R: WeakAlignedBufferPoolRef<P, ALIGNMENT, A>, A: Allocator + Clone> Clone for BufferPoolAllocator<P, ALIGNMENT, R, A>
impl<P: BufferRetentionPolicy, const ALIGNMENT: usize, R: WeakAlignedBufferPoolRef<P, ALIGNMENT, A>, A: Allocator + Clone> Clone for BufferPoolAllocator<P, ALIGNMENT, R, A>
Auto Trait Implementations§
impl<P, const ALIGNMENT: usize, R, A> Freeze for BufferPoolAllocator<P, ALIGNMENT, R, A>
impl<P, const ALIGNMENT: usize, R, A> RefUnwindSafe for BufferPoolAllocator<P, ALIGNMENT, R, A>
impl<P, const ALIGNMENT: usize, R, A> Send for BufferPoolAllocator<P, ALIGNMENT, R, A>
impl<P, const ALIGNMENT: usize, R, A> Sync for BufferPoolAllocator<P, ALIGNMENT, R, A>
impl<P, const ALIGNMENT: usize, R, A> Unpin for BufferPoolAllocator<P, ALIGNMENT, R, A>
impl<P, const ALIGNMENT: usize, R, A> UnwindSafe for BufferPoolAllocator<P, ALIGNMENT, R, A>
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