viirya commented on code in PR #3687: URL: https://github.com/apache/arrow-rs/pull/3687#discussion_r1103067645
########## 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: By `forget`ing it, will some non-pointer fields like `flags` and `n_children` be released? Supposed that it should be but wanted to verify it. -- 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-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org