-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[release/7.0] Ensure we cleanup the marshalling for elements of collections (stateful and stateless) #76693
Conversation
Tagging subscribers to this area: @dotnet/interop-contrib Issue DetailsBackport of #76629 to release/7.0 /cc @AaronRobinsonMSFT @jkoritzinsky Customer ImpactTestingRiskIMPORTANT: Is this backport for a servicing release? If so and this change touches code that ships in a NuGet package, please make certain that you have added any necessary package authoring and gotten it explicitly reviewed.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved. please get a code review and we will take for consideration in 7 ga.
@AaronRobinsonMSFT can you take a look at the ci failures? |
@jeffschwMSFT Yep, I will be updating this PR today. |
...m.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/MarshallingAttributeInfo.cs
Outdated
Show resolved
Hide resolved
…erop.SourceGeneration/MarshallingAttributeInfo.cs Co-authored-by: Elinor Fung <elfung@microsoft.com>
CI failure was a timeout cancellation during the execution of the Approved by Tactics. Signed off. Ready to merge. |
Backport of #76629 to release/7.0
/cc @AaronRobinsonMSFT @jkoritzinsky
Customer Impact
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. During the late revision of the new marshaller design, this was missed due to the limited impact on broader BCL usage. This is a part of the new
LibraryImport
marshaller for .NET 7 so doesn't represent any previous release regression. Without this change we will be shipping a set of scenarios where unmanaged memory is leaked. This was limited to a narrow set of types in the BCL since most types are blittable and don't need the clean-up pass, but those types that are impacted tend to be used in scenarios where leaks would very impactful -System.Drawing
.This was discovered through manual inspection - see #76584.
Testing
Testing was added for this clean-up. We had already added verification testing for many of the other clean-up paths.
Risk
Low. This is adding back some missing logic from the new APIs for people to request element marshalling.