Repository navigation
Remove AOT unfriendly Marshal.SizeOf calls - #6098
Merged
max-charlamb merged 2 commits intoOct 21, 2026
Merged
max-charlamb merged 2 commits into
max-charlamb merged 2 commits into
Conversation
Replace Marshal.SizeOf(Type) with explicit primitive register widths, preserving register metadata and rejecting unsupported field types. Add coverage for all six ClrMD context layouts against the existing marshalling sizes. Isolated NativeAOT publish has zero AOT/trimming warnings; native and CoreCLR register metadata match for every supported architecture. Co-authored-by: Copilot <[email protected]> Copilot-Session: ab215431-2cf9-4421-8822-d411adca0f92
Handle signed and unsigned 16-, 32-, and 64-bit register fields in paired cases. Use generic Marshal.SizeOf for VS_FIXEDFILEINFO in SOSHost and DebuggerServices. Remove the register test file as requested. Co-authored-by: Copilot <[email protected]> Copilot-Session: ab215431-2cf9-4421-8822-d411adca0f92
hoyosjs
reviewed
Oct 13, 2026
hoyosjs
approved these changes
Oct 20, 2026
steveisok
approved these changes
Oct 20, 2026
7 of 8 tasks
This was referenced Oct 23, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Uses NativeAOT-friendly size calculations in SOS, based independently on origin/main.
Validation
The audit covers these sizing paths, not a claim that the entire SOS dependency closure is already NativeAOT-compatible. No framework retargeting, COM, JSON, command-factory, or packaging changes are included.