#[repr(C, packed(4))]pub struct CMBlockBufferCustomBlockSource {
pub version: u32,
pub AllocateBlock: Option<unsafe extern "C-unwind" fn(*mut c_void, usize) -> *mut c_void>,
pub FreeBlock: Option<unsafe extern "C-unwind" fn(*mut c_void, NonNull<c_void>, usize)>,
pub refCon: *mut c_void,
}CMBlockBuffer only.Expand description
Used with functions that accept a memory block allocator, this structure allows a client to provide a custom facility for obtaining the memory block to be used in a CMBlockBuffer. The AllocateBlock function must be non-zero if the CMBlockBuffer code will need to call for allocation (not required if a previously-obtained memory block is provided to the CMBlockBuffer API). The FreeBlock() routine, if non-NULL, will be called once when the CMBlockBuffer is disposed. It will not be called if no memory block is ever allocated or supplied. The refCon will be passed to both the AllocateBlock and FreeBlock() calls. The client is responsible for its disposal (if any) during the FreeBlock() callback.
Note that for 64-bit architectures, this struct contains misaligned function pointers. To avoid link-time issues, it is recommended that clients fill CMBlockBufferCustomBlockSource’s function pointer fields by using assignment statements, rather than declaring them as global or static structs. The functions that accept CMBlockBufferCustomBlockSource pointers copy the fields and do not require the struct to stay valid after they return.
See also Apple’s documentation
Fields§
§version: u32§AllocateBlock: Option<unsafe extern "C-unwind" fn(*mut c_void, usize) -> *mut c_void>§FreeBlock: Option<unsafe extern "C-unwind" fn(*mut c_void, NonNull<c_void>, usize)>§refCon: *mut c_voidTrait Implementations§
Source§impl Clone for CMBlockBufferCustomBlockSource
impl Clone for CMBlockBufferCustomBlockSource
Source§fn clone(&self) -> CMBlockBufferCustomBlockSource
fn clone(&self) -> CMBlockBufferCustomBlockSource
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Encode for CMBlockBufferCustomBlockSource
Available on crate feature objc2 only.
impl Encode for CMBlockBufferCustomBlockSource
objc2 only.Source§impl PartialEq for CMBlockBufferCustomBlockSource
impl PartialEq for CMBlockBufferCustomBlockSource
Source§fn eq(&self, other: &CMBlockBufferCustomBlockSource) -> bool
fn eq(&self, other: &CMBlockBufferCustomBlockSource) -> bool
self and other values to be equal, and is used by ==.Source§impl RefEncode for CMBlockBufferCustomBlockSource
Available on crate feature objc2 only.
impl RefEncode for CMBlockBufferCustomBlockSource
objc2 only.