-
Notifications
You must be signed in to change notification settings - Fork 566
Description
Android framework version
net11.0-android (Preview)
Affected platform version
.NET 11
Description
Docs: https://learn.microsoft.com/en-us/dotnet/standard/native-interop/pinvoke-source-generation
When it's not using source generation, the built-in interop system in the .NET runtime generates an IL stub—a stream of IL instructions that is JIT-ed—at runtime to facilitate the transition from managed to unmanaged. [...] Since this IL stub is generated at runtime, it isn't available for ahead-of-time (AOT) compiler or IL trimming scenarios.
We should consider replacing our [DllImport] with [LibraryImport] to reduce the amount of code that needs to be JITted at runtime and allow R2R to precompile more code into native code.
We should focus only on P/Invokes into CoreCLR host code. We do not need to make changes to Mono P/Invokes.
Steps to Reproduce
Did you find any workaround?
No response