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
{{ message }}
Repository navigation
Track stateful marshallers for each element in unmanaged to managed stubs #89462
In order to be able to free each element in an array, the generated code should store stateful element marshallers in an array to free them in the AssignOut stage after marshalling.
changed the title [-]In order to be able to free each element in an array, the generated code should store stateful element marshallers in an array to free them in the AssignOut stage after marshalling.[/-][+]Track stateful marshallers for each element in unmanaged to managed stubs[/+]on Jul 25, 2023
Activity
jkoritzinsky commentedon Jul 25, 2023
We don’t support stateful marshallers for element marshallers, so this is out of scope for now. Marking this as Future
jtschuster commentedon Jul 25, 2023
I don't think we warn for these, I'll make an issue to add a warning
[-]In order to be able to free each element in an array, the generated code should store stateful element marshallers in an array to free them in the AssignOut stage after marshalling.[/-][+]Track stateful marshallers for each element in unmanaged to managed stubs[/+]jkoritzinsky commentedon Jul 25, 2023
We warn in the analyzer for CustomMarshallerAttribute usage, which isn't referenced in the source generator tests
jwosty commentedon Nov 7, 2023
Is there an issue tracking stateful marshaling of collection elements? Or is this that issue now?
I would really like this. Without this, I currently have to resort to manual boilerplate to pass
SafeHandle[]andSpan<SafeHandle>to native code.dotnet-policy-service commentedon Apr 13, 2026
Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.