You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "teo-tsirpanis (via GitHub)" <gi...@apache.org> on 2023/05/28 23:07:11 UTC
[GitHub] [arrow] teo-tsirpanis opened a new issue, #35809: [C#] Issues with the C data interface implementation.
teo-tsirpanis opened a new issue, #35809:
URL: https://github.com/apache/arrow/issues/35809
### Describe the bug, including details regarding any error messages, version, and platform.
I took a look at the code in the `Apache.Arrow.C` namespace and noticed the following things:
* The native callbacks can use `[UnmanagedCallersOnly]` on supported frameworks (.NET 5+). This way, taking the pointer to them will be more efficient and does not involve delegates.
* We are manually zeroing the structs we just allocated (https://github.com/apache/arrow/blob/05fe0d25834fd1629d71ceb51f0281b44a511f94/csharp/src/Apache.Arrow/C/CArrowArray.cs#L54-L63 for example). We can zero them by just writing `*ptr = default` which is more efficient.
* When releasing an exported array stream [we don't free the `GCHandle` to the managed object](https://github.com/apache/arrow/blob/05fe0d25834fd1629d71ceb51f0281b44a511f94/csharp/src/Apache.Arrow/C/CArrowArrayStreamExporter.cs#L116-L121), causing a memory leak.
* When a function on an imported array fails, we don't include the result of `get_last_error` in the exception message.
* We free the last exported array stream error message with `Marshal.AllocCoTaskMem`, while we had allocated it with `Marshal.AllocHGlobal`. https://github.com/apache/arrow/blob/05fe0d25834fd1629d71ceb51f0281b44a511f94/csharp/src/Apache.Arrow/C/CArrowArrayStreamExporter.cs#L173
* And more smaller stuff.
I will open a PR to address them.
### Component(s)
C#
--
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: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] westonpace closed issue #35809: [C#] Issues with the C data interface implementation.
Posted by "westonpace (via GitHub)" <gi...@apache.org>.
westonpace closed issue #35809: [C#] Issues with the C data interface implementation.
URL: https://github.com/apache/arrow/issues/35809
--
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: issues-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org