-
Notifications
You must be signed in to change notification settings - Fork 5k
Move Untracked_Release to native code to avoid problems during shutdown #115489
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
Move Untracked_Release to native code to avoid problems during shutdown #115489
Conversation
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.
Pull Request Overview
This PR moves the implementation of untracked COM reference counting from managed to native code to avoid problems during process shutdown. Key changes include:
- Updating ReferenceTrackerHost.cs to call a native provider for AddRef/Release.
- Removing managed implementations of Untracked_AddRef/Untracked_Release from ComWrappers.cs.
- Adding native implementations and entrypoints in multiple interop and runtime files.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
System/Runtime/InteropServices/ReferenceTrackerHost.cs | Updated to use native function pointers via GetUntrackedIUnknownImpl |
System/Runtime/InteropServices/ComWrappers.cs | Removed managed implementations of untracked ref counting |
vm/qcallentrypoints.cpp | Added entries for native untracked AddRef/Release |
vm/interoplibinterface_comwrappers.h | Declared native functions for untracked AddRef/Release |
vm/interoplibinterface_comwrappers.cpp | Defined native implementations for untracked AddRef/Release and exposed them |
nativeaot/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs | Added extern declaration for RhUntracked_Release |
nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/TrackerObjectManager.NativeAot.cs | Updated to use the native GetUntrackedIUnknownImpl pattern |
nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.NativeAot.cs | Added a native GetUntrackedIUnknownImpl method to acquire function pointers |
nativeaot/Runtime/HandleTableHelpers.cpp | Implemented native RhUntracked_Release to avoid GC transitions during shutdown |
System/Runtime/InteropServices/ComWrappers.CoreCLR.cs | Added native imports for untracked AddRef/Release |
Tagging subscribers to this area: @dotnet/interop-contrib |
src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.CoreCLR.cs
Outdated
Show resolved
Hide resolved
...nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.NativeAot.cs
Outdated
Show resolved
Hide resolved
/ba-g failures unrelated |
Fixes #115460
Fixes #115462