You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 (
### Rationale for this change
This PR fixes issues identified while reading the code of the `Apache.Arrow.C` namespace.
### What changes are included in this PR?
See each commit message for more details.
### Are these changes tested?
Using the existing test suite.
### Are there any user-facing changes?
No.
* Closes: #35809
Authored-by: Theodore Tsirpanis <teo@tsirpanis.gr>
Signed-off-by: Weston Pace <weston.pace@gmail.com>
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:[UnmanagedCallersOnly]
on supported frameworks (.NET 5+). This way, taking the pointer to them will be more efficient and does not involve delegates.arrow/csharp/src/Apache.Arrow/C/CArrowArray.cs
Lines 54 to 63 in 05fe0d2
*ptr = default
which is more efficient.GCHandle
to the managed object, causing a memory leak.get_last_error
in the exception message.Marshal.AllocCoTaskMem
, while we had allocated it withMarshal.AllocHGlobal
.arrow/csharp/src/Apache.Arrow/C/CArrowArrayStreamExporter.cs
Line 173 in 05fe0d2
I will open a PR to address them.
Component(s)
C#
The text was updated successfully, but these errors were encountered: