-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Don't allow inlining the NativeAOT-only unsafe accessor #116646
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
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
Prevents the NativeAOT-only unsafe accessor from being inlined by marking the extern CreateObjectArrayDelegate
method with NoInlining
, addressing a workaround needed by EF Core.
- Added
[MethodImpl(MethodImplOptions.NoInlining)]
to the static extern call site. - Targets the
CreateObjectArrayDelegate
method inDelegateHelpers
to ensure it isn’t inlined by the JIT/AOT compiler.
Comments suppressed due to low confidence (1)
src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/DelegateHelpers.cs:33
- [nitpick] Add a brief comment above this attribute to explain why
NoInlining
is required (e.g., to prevent inlining of the NativeAOT-only unsafe accessor), providing context for future maintainers.
[MethodImpl(MethodImplOptions.NoInlining)]
Tagging subscribers to this area: @cston |
There may be a few more that deserve the same treatment:
An alternative for this one is wrap the caller with |
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.
Thanks
/ba-g wasm build failure is unrelated |
Should unblock dotnet/efcore#36242
Implements workaround mentioned in dotnet/efcore#36242 (comment)