roee88 commented on a change in pull request #600:
URL: https://github.com/apache/arrow-rs/pull/600#discussion_r675320016
##########
File path: arrow/src/ffi.rs
##########
@@ -158,23 +195,26 @@ impl FFI_ArrowSchema {
.map(Box::into_raw)
.collect::<Box<_>>();
- this.format = CString::new(format).unwrap().into_raw();
- this.release = Some(release_schema);
+ this.release = Some(release_schema_callback);
this.n_children = children_ptr.len() as i64;
let mut private_data = Box::new(SchemaPrivateData {
children: children_ptr,
+ format: CString::new(format).unwrap(),
+ name: None,
});
// intentionally set from private_data (see
https://github.com/apache/arrow-rs/issues/580)
this.children = private_data.children.as_mut_ptr();
+ this.format = private_data.format.as_ptr();
this.private_data = Box::into_raw(private_data) as *mut c_void;
Ok(this)
}
pub fn with_name(mut self, name: &str) -> Result<Self> {
+ // TODO: should go in private data just like format
Review comment:
@kszucs I opened this draft PR mainly for discussion this
##########
File path: arrow/src/ffi.rs
##########
@@ -158,23 +195,26 @@ impl FFI_ArrowSchema {
.map(Box::into_raw)
.collect::<Box<_>>();
- this.format = CString::new(format).unwrap().into_raw();
- this.release = Some(release_schema);
+ this.release = Some(release_schema_callback);
this.n_children = children_ptr.len() as i64;
let mut private_data = Box::new(SchemaPrivateData {
children: children_ptr,
+ format: CString::new(format).unwrap(),
+ name: None,
});
// intentionally set from private_data (see
https://github.com/apache/arrow-rs/issues/580)
this.children = private_data.children.as_mut_ptr();
+ this.format = private_data.format.as_ptr();
this.private_data = Box::into_raw(private_data) as *mut c_void;
Ok(this)
}
pub fn with_name(mut self, name: &str) -> Result<Self> {
+ // TODO: should go in private data just like format
Review comment:
@kszucs I opened this draft PR mainly for discussing this
--
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]