Skip to main content

OH_NativeBuffer_Alloc

Function OH_NativeBuffer_Alloc 

Source
pub unsafe extern "C" fn OH_NativeBuffer_Alloc(
    config: *const OH_NativeBuffer_Config,
) -> *mut OH_NativeBuffer
Expand description

@brief Alloc a OH_NativeBuffer that matches the passed BufferRequestConfig. \n A new OH_NativeBuffer instance is created each time this function is called.\n This interface needs to be used in conjunction with OH_NativeBuffer_Unreference, otherwise memory leaks will occur.\n This interface is a non-thread-safe type interface.\n

@syscap SystemCapability.Graphic.Graphic2D.NativeBuffer @param config Indicates the pointer to a BufferRequestConfig instance. @return Returns the pointer to the OH_NativeBuffer instance created if the operation is successful, \n returns NULL otherwise. @since 9 @version 1.0