tustvold commented on code in PR #2303:
URL: https://github.com/apache/arrow-rs/pull/2303#discussion_r936613821
##########
arrow/src/array/array.rs:
##########
@@ -733,42 +708,6 @@ fn new_null_sized_decimal(
})
}
-/// Creates a new array from two FFI pointers. Used to import arrays from the
C Data Interface
-/// # Safety
-/// Assumes that these pointers represent valid C Data Interfaces, both in
memory
-/// representation and lifetime via the `release` mechanism.
-pub unsafe fn make_array_from_raw(
- array: *const ffi::FFI_ArrowArray,
- schema: *const ffi::FFI_ArrowSchema,
-) -> Result<ArrayRef> {
- let array = ffi::ArrowArray::try_from_raw(array, schema)?;
- let data = ArrayData::try_from(array)?;
- Ok(make_array(data))
-}
-
-/// Exports an array to raw pointers of the C Data Interface provided by the
consumer.
-/// # Safety
-/// Assumes that these pointers represent valid C Data Interfaces, both in
memory
-/// representation and lifetime via the `release` mechanism.
-///
-/// This function copies the content of two FFI structs [ffi::FFI_ArrowArray]
and
-/// [ffi::FFI_ArrowSchema] in the array to the location pointed by the raw
pointers.
-/// Usually the raw pointers are provided by the array data consumer.
-pub unsafe fn export_array_into_raw(
- src: ArrayRef,
- out_array: *mut ffi::FFI_ArrowArray,
- out_schema: *mut ffi::FFI_ArrowSchema,
-) -> Result<()> {
- let data = src.data();
- let array = ffi::FFI_ArrowArray::new(data);
- let schema = ffi::FFI_ArrowSchema::try_from(data.data_type())?;
-
- std::ptr::write_unaligned(out_array, array);
- std::ptr::write_unaligned(out_schema, schema);
-
- Ok(())
-}
-
Review Comment:
These are moved to the ffi module to make the feature flags easier
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]