You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/03/16 05:54:16 UTC

[GitHub] [arrow-rs] viirya commented on a change in pull request #1449: Remove Clone and copy source structs internally

viirya commented on a change in pull request #1449:
URL: https://github.com/apache/arrow-rs/pull/1449#discussion_r827650508



##########
File path: arrow/src/ffi.rs
##########
@@ -781,11 +781,19 @@ impl ArrowArray {
                     .to_string(),
             ));
         };
-        let ffi_array = (*array).clone();
-        let ffi_schema = (*schema).clone();
+
+        let array_mut = array as *mut FFI_ArrowArray;
+        let schema_mut = schema as *mut FFI_ArrowSchema;
+
+        let array_data = std::ptr::replace(array_mut, FFI_ArrowArray::empty());

Review comment:
       It is correct that with one single API, we cannot deal with both cases: raw pointers from Arc and not from Arc.
   
   I'm not sure two separate APIs is good. With a single API, we can ask users to take care of releasing the raw pointers (either Arc or not) by themselves.
   
   




-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org