#[unsafe(no_mangle)]pub unsafe extern "C" fn hurray_buffer_list_new(
capacity: u64,
out_list: *mut *mut HurrayBufferList,
) -> HurrayStatusExpand description
Creates an empty HurrayBufferList.
capacity is a hint only; the list grows as needed. Pass the tensor’s
buffer count to avoid reallocation.
The caller owns the returned list and MUST destroy it exactly once with
hurray_buffer_list_destroy.
§Safety
out_list MUST be a valid, non-null, writable pointer.
§Examples
use hurray_ffi::buffer_list::{hurray_buffer_list_destroy, hurray_buffer_list_new};
use hurray_ffi::{HurrayBufferList, HURRAY_OK};
let mut list: *mut HurrayBufferList = std::ptr::null_mut();
assert_eq!(unsafe { hurray_buffer_list_new(2, &mut list) }, HURRAY_OK);
assert!(!list.is_null());
assert_eq!(unsafe { hurray_buffer_list_destroy(&mut list) }, HURRAY_OK);
assert!(list.is_null()); // destroy nulls the caller's pointer