Share ObjectiveCMarshal reference-tracking storage between CoreCLR and NativeAOT#128961
Draft
Copilot wants to merge 3 commits into
Draft
Share ObjectiveCMarshal reference-tracking storage between CoreCLR and NativeAOT#128961Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Co-authored-by: AaronRobinsonMSFT <30635565+AaronRobinsonMSFT@users.noreply.github.com>
Co-authored-by: AaronRobinsonMSFT <30635565+AaronRobinsonMSFT@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Share ObjectiveCMarshal API implementation between CoreCLR and NativeAOT
Share ObjectiveCMarshal reference-tracking storage between CoreCLR and NativeAOT
Jun 3, 2026
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
rcj1
reviewed
Jun 3, 2026
| registry.Register<ISignature>("c1", static t => new Signature_1(t)); | ||
| registry.Register<IBuiltInCOM>("c1", static t => new BuiltInCOM_1(t)); | ||
| registry.Register<IObjectiveCMarshal>("c1", static t => new ObjectiveCMarshal_1(t)); | ||
| registry.Register<IObjectiveCMarshal>("c2", static t => new ObjectiveCMarshal_2(t)); |
Contributor
There was a problem hiding this comment.
We aren’t revving the versions yet.
Member
There was a problem hiding this comment.
My assumption here is the current cDAC works on .NET 10 for Objective-C. This is a break change so I assume we need to ensure .NET 10 continues to work.
Contributor
There was a problem hiding this comment.
We do not support .NET 10 with cDAC. We are making changes to the runtime throughout .NET 11 to support cDAC, for example #125243.
Contributor
There was a problem hiding this comment.
Any individual API or contract may just happen to work, but that is not a guarantee or promise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ObjectiveCMarshalhad divergent CoreCLR and NativeAOT implementations for tagged reference-tracking memory. This change moves CoreCLR to the sameConditionalWeakTable<object, ObjcTrackingInformation>model used by NativeAOT and updates diagnostics contracts accordingly.s_objectsCWT andObjcTrackingInformationlifecycle logic inObjectiveCMarshal.CoreCLR.cs.CreateReferenceTrackingHandle/GetOrCreateReferenceTrackingMemoryflow to use managed CWT-backed memory for both runtimes.Initializenow passes the CWT instance to native for unmanaged lookup during GC callbacks.interoplibinterface_objc.cpp.ConditionalWeakTableObject::TryGetValue) to resolve tagged memory from managed state.ObjCMarshal_AllocateReferenceTrackingHandle).ConditionalWeakTablenative lookup helpers for this suspended-runtime callback scenario and clarified constraints in comments.c2that reads tagged memory viaObjectiveCMarshal.s_objectsand CWT entries.c2in CoreCLR contract registry and updated descriptor contract version.ObjectiveCMarshalstatic table andObjcTrackingInformation._memory.