tustvold commented on code in PR #3687:
URL: https://github.com/apache/arrow-rs/pull/3687#discussion_r1103076802
##########
arrow/src/ffi_stream.rs:
##########
@@ -203,11 +204,11 @@ impl ExportedArrayStream {
let schema = FFI_ArrowSchema::try_from(reader.schema().as_ref());
match schema {
- Ok(mut schema) => unsafe {
- std::ptr::copy(&schema as *const FFI_ArrowSchema, out, 1);
- schema.release = None;
+ Ok(schema) => {
+ unsafe { std::ptr::copy(addr_of!(schema), out, 1) };
+ std::mem::forget(schema);
Review Comment:
`flags` and `n_children` aren't separate allocations, they are all stored
inline with the rest of the struct members on the stack allocated `schema`. So
no they aren't freed, but they also don't need to be
--
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]