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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to