Skip to content

Ensure we cleanup the marshalling for elements of collections (stateful and stateless) #76629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 5, 2022

Conversation

jkoritzinsky
Copy link
Member

We accidentally lost the element marshalling when moving to the released marshaller design. This PR adds it back with matching logic to the previous marshaller design.

Verified manually that we emit the right code for the case in #76584

Fixes #76584

Given the scope of the break that this fixes (memory leaks), I think this is a backport candidate.

@jkoritzinsky jkoritzinsky added area-System.Runtime.InteropServices source-generator Indicates an issue with a source generator feature labels Oct 4, 2022
@ghost ghost assigned jkoritzinsky Oct 4, 2022
@ghost
Copy link

ghost commented Oct 4, 2022

Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.

Issue Details

We accidentally lost the element marshalling when moving to the released marshaller design. This PR adds it back with matching logic to the previous marshaller design.

Verified manually that we emit the right code for the case in #76584

Fixes #76584

Given the scope of the break that this fixes (memory leaks), I think this is a backport candidate.

Author: jkoritzinsky
Assignees: -
Labels:

area-System.Runtime.InteropServices, source-generator

Milestone: -

@elinor-fung
Copy link
Member

What do you think about adding tests that just validate the Free of a marshaller implementation gets called? Similar to ones we have for OnInvoked and the guaranteed unmarshalling methods.

@jkoritzinsky
Copy link
Member Author

I'll try to come up with a test.

@AaronRobinsonMSFT
Copy link
Member

Given the scope of the break that this fixes (memory leaks), I think this is a backport candidate.

Yes, it is.

@AaronRobinsonMSFT AaronRobinsonMSFT merged commit 3a578af into dotnet:main Oct 5, 2022
@AaronRobinsonMSFT
Copy link
Member

/backport to release/7.0

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2022

Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/3193476808

@ghost ghost locked as resolved and limited conversation to collaborators Nov 5, 2022
@jkoritzinsky jkoritzinsky deleted the element-free-fix branch March 22, 2024 01:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Runtime.InteropServices source-generator Indicates an issue with a source generator feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MARSHALLED_UNICODE_STRING[] array marshalling leaks memory
3 participants