Relax argument checks on pinned GCHandles#68694
Conversation
Relax argument checks on pinned GCHandles to allow any objects without references for consistency with DisableRuntimeMarshalling. Fixes dotnet#68686
|
Tagging subscribers to this area: @dotnet/interop-contrib Issue DetailsRelax argument checks on pinned GCHandles to allow any objects without references for consistency with DisableRuntimeMarshalling. Fixes #68686
|
|
The mono changes look ok to me. |
AaronRobinsonMSFT
left a comment
There was a problem hiding this comment.
It seems NativeAOT already has this similar definition and only checks for null or if the type has pointers. I think at this point there is really no argument against adding support in all cases.
What about the following that mark char and bool as non-blittable? I think Crossgen or NativeAOT might trigger off of that in some manner.
runtime/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.cs
Lines 273 to 312 in 8656518
...sts/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/GCHandleTests.cs
Outdated
Show resolved
Hide resolved
…ime.InteropServices.UnitTests/System/Runtime/InteropServices/GCHandleTests.cs Co-authored-by: Aaron Robinson <arobins@microsoft.com>
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
lambdageek
left a comment
There was a problem hiding this comment.
Pinnable if it doesn't have references?
src/mono/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Mono.cs
Outdated
Show resolved
Hide resolved
…ices/Marshal.Mono.cs Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
I do not see a problem here. The marshaling without |
|
Improvements on windows arm64: dotnet/perf-autofiling-issues#5147, dotnet/perf-autofiling-issues#5148 |
Relax argument checks on pinned GCHandles to allow any objects without references for consistency with DisableRuntimeMarshalling.
Fixes #68686