Skip to main content

BufferAllocator

Trait BufferAllocator 

Source
pub trait BufferAllocator<const ALIGNMENT: usize>: Allocator {
    // Provided method
    unsafe fn deallocate_buffer(&self, raw: RawBuffer<ALIGNMENT>) { ... }
}
Expand description

A trait for types that can allocate aligned buffers.

Provided Methods§

Source

unsafe fn deallocate_buffer(&self, raw: RawBuffer<ALIGNMENT>)

Deallocates the buffer.

§Safety
  • ptr must denote a block of memory currently allocated via this allocator, and
  • layout must fit that block of memory.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<const ALIGNMENT: usize> BufferAllocator<ALIGNMENT> for Global