pub unsafe trait AllocatorImpl: GstObjectImpl + ObjectSubclass{
// Provided methods
unsafe fn alloc(
&self,
size: usize,
params: &AllocationParams,
) -> *mut GstMemory { ... }
unsafe fn free(&self, memory: *mut GstMemory) { ... }
}Provided Methods§
Sourceunsafe fn alloc(&self, size: usize, params: &AllocationParams) -> *mut GstMemory
unsafe fn alloc(&self, size: usize, params: &AllocationParams) -> *mut GstMemory
Use self to allocate a new memory block with memory that is at least
size big.
The optional params can specify the prefix and padding for the memory. If
None is passed, no flags, no extra prefix/padding and a default alignment is
used.
The prefix/padding will be filled with 0 if flags contains
MemoryFlags::ZERO_PREFIXED and MemoryFlags::ZERO_PADDED respectively.
When self is None, the default allocator will be used.
The alignment in params is given as a bitmask so that align + 1 equals
the amount of bytes to align to. For example, to align to 8 bytes,
use an alignment of 7.
§size
size of the visible memory area
§params
optional parameters
§Returns
a new Memory.
unsafe fn free(&self, memory: *mut GstMemory)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.