You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "CurtHagenlocher (via GitHub)" <gi...@apache.org> on 2023/07/24 16:31:34 UTC
[GitHub] [arrow-adbc] CurtHagenlocher opened a new pull request, #931: fix(csharp): fix C api to work under .NET 4.7.2
CurtHagenlocher opened a new pull request, #931:
URL: https://github.com/apache/arrow-adbc/pull/931
Addresses #930
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-adbc] CurtHagenlocher commented on a diff in pull request #931: fix(csharp): fix C api to work under .NET 4.7.2
Posted by "CurtHagenlocher (via GitHub)" <gi...@apache.org>.
CurtHagenlocher commented on code in PR #931:
URL: https://github.com/apache/arrow-adbc/pull/931#discussion_r1272531317
##########
csharp/src/Apache.Arrow.Adbc/C/NativeDelegate.cs:
##########
@@ -20,22 +20,15 @@
namespace Apache.Arrow.Adbc.C
{
- internal readonly struct NativeDelegate<T>
+ internal readonly struct NativeDelegate<T> where T : Delegate
{
private readonly T _managedDelegate; // For lifetime management
- private readonly IntPtr _nativePointer;
public NativeDelegate(T managedDelegate)
{
_managedDelegate = managedDelegate;
- _nativePointer = Marshal.GetFunctionPointerForDelegate<T>(managedDelegate);
}
- public static implicit operator IntPtr(NativeDelegate<T> thunk)
- {
- return thunk._nativePointer;
- }
-
- public IntPtr Pointer { get { return _nativePointer; } }
+ public IntPtr Pointer { get; }
Review Comment:
Hmm... not sure what this says about our testing having passed :/. But yes, it looks like I did a poor job copying over from the changed version in the Arrow repo.
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-adbc] lidavidm commented on a diff in pull request #931: fix(csharp): fix C api to work under .NET 4.7.2
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on code in PR #931:
URL: https://github.com/apache/arrow-adbc/pull/931#discussion_r1272502507
##########
csharp/src/Apache.Arrow.Adbc/C/NativeDelegate.cs:
##########
@@ -20,22 +20,15 @@
namespace Apache.Arrow.Adbc.C
{
- internal readonly struct NativeDelegate<T>
+ internal readonly struct NativeDelegate<T> where T : Delegate
{
private readonly T _managedDelegate; // For lifetime management
- private readonly IntPtr _nativePointer;
public NativeDelegate(T managedDelegate)
{
_managedDelegate = managedDelegate;
- _nativePointer = Marshal.GetFunctionPointerForDelegate<T>(managedDelegate);
}
- public static implicit operator IntPtr(NativeDelegate<T> thunk)
- {
- return thunk._nativePointer;
- }
-
- public IntPtr Pointer { get { return _nativePointer; } }
+ public IntPtr Pointer { get; }
Review Comment:
Isn't this always a null pointer then?
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-adbc] CurtHagenlocher commented on pull request #931: fix(csharp): fix C api to work under .NET 4.7.2
Posted by "CurtHagenlocher (via GitHub)" <gi...@apache.org>.
CurtHagenlocher commented on PR #931:
URL: https://github.com/apache/arrow-adbc/pull/931#issuecomment-1648239717
For consistency, this deliberately follows the same patterns in the Core C# Arrow library.
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-adbc] CurtHagenlocher commented on a diff in pull request #931: fix(csharp): fix C api to work under .NET 4.7.2
Posted by "CurtHagenlocher (via GitHub)" <gi...@apache.org>.
CurtHagenlocher commented on code in PR #931:
URL: https://github.com/apache/arrow-adbc/pull/931#discussion_r1272533366
##########
csharp/src/Apache.Arrow.Adbc/C/CAdbcPartitions.cs:
##########
@@ -69,6 +70,10 @@ public unsafe struct CAdbcPartitions
/// Unlike other structures, this is an embedded callback to make it
/// easier for the driver manager and driver to cooperate.
/// </summary>
- public delegate* unmanaged[Stdcall]<CAdbcPartitions*, void> release;
+#if NET5_0_OR_GREATER
+ public delegate* unmanaged<CAdbcPartitions*, void> release;
Review Comment:
should be internal
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-adbc] lidavidm commented on a diff in pull request #931: fix(csharp): fix C api to work under .NET 4.7.2
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on code in PR #931:
URL: https://github.com/apache/arrow-adbc/pull/931#discussion_r1272550674
##########
csharp/src/Apache.Arrow.Adbc/C/NativeDelegate.cs:
##########
@@ -20,22 +20,15 @@
namespace Apache.Arrow.Adbc.C
{
- internal readonly struct NativeDelegate<T>
+ internal readonly struct NativeDelegate<T> where T : Delegate
{
private readonly T _managedDelegate; // For lifetime management
- private readonly IntPtr _nativePointer;
public NativeDelegate(T managedDelegate)
{
_managedDelegate = managedDelegate;
- _nativePointer = Marshal.GetFunctionPointerForDelegate<T>(managedDelegate);
}
- public static implicit operator IntPtr(NativeDelegate<T> thunk)
- {
- return thunk._nativePointer;
- }
-
- public IntPtr Pointer { get { return _nativePointer; } }
+ public IntPtr Pointer { get; }
Review Comment:
We don't run C♯ in CI yet here, for what it's worth (unless you mean your local testing)
##########
csharp/src/Apache.Arrow.Adbc/C/NativeDelegate.cs:
##########
@@ -20,22 +20,15 @@
namespace Apache.Arrow.Adbc.C
{
- internal readonly struct NativeDelegate<T>
+ internal readonly struct NativeDelegate<T> where T : Delegate
{
private readonly T _managedDelegate; // For lifetime management
- private readonly IntPtr _nativePointer;
public NativeDelegate(T managedDelegate)
{
_managedDelegate = managedDelegate;
- _nativePointer = Marshal.GetFunctionPointerForDelegate<T>(managedDelegate);
}
- public static implicit operator IntPtr(NativeDelegate<T> thunk)
- {
- return thunk._nativePointer;
- }
-
- public IntPtr Pointer { get { return _nativePointer; } }
+ public IntPtr Pointer { get; }
Review Comment:
We don't run C♯ in CI yet here, for what it's worth (unless you mean your local testing)
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-adbc] lidavidm merged pull request #931: fix(csharp): fix C api to work under .NET 4.7.2
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm merged PR #931:
URL: https://github.com/apache/arrow-adbc/pull/931
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org