MCPcopy Create free account
hub / github.com/apache/arrow-rs / release_array

Function release_array

arrow-data/src/ffi.rs:80–96  ·  view source on GitHub ↗

callback used to drop [FFI_ArrowArray] when it is exported

(array: *mut FFI_ArrowArray)

Source from the content-addressed store, hash-verified

78
79// callback used to drop [FFI_ArrowArray] when it is exported
80unsafe extern "C" fn release_array(array: *mut FFI_ArrowArray) {
81 if array.is_null() {
82 return;
83 }
84 let array = unsafe { &mut *array };
85
86 // take ownership of `private_data`, therefore dropping it`
87 let private = unsafe { Box::from_raw(array.private_data as *mut ArrayPrivateData) };
88 for child in private.children.iter() {
89 let _ = unsafe { Box::from_raw(*child) };
90 }
91 if !private.dictionary.is_null() {
92 let _ = unsafe { Box::from_raw(private.dictionary) };
93 }
94
95 array.release = None;
96}
97
98/// Aligns the provided `nulls` to the provided `data_offset`
99///

Callers

nothing calls this directly

Calls 2

is_nullMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected