Emit SkipLocalsInit
for .NET 5
#785
Labels
enhancement
Proposed change to current functionality
generator
Issues binding a Java library (generator, class-parse, etc.)
Milestone
C#9 allows specifying the System.Runtime.CompilerServices.SkipLocalsInitAttribute custom attribute on methods (and other things) for performance reasons:
Our generated binding code does use
stackalloc
, e.g. https://github.com/xamarin/java.interop/blob/b0d170c1002e5481564c0afc78afd6dbf3d40e66/tests/generator-Tests/expected.ji/Adapters/Xamarin.Test.AdapterView.cs#L117-L129We should consider updating
generator
output to place[SkipLocalsInit]
on such methods, e.g.Problems
The
SkipLocalsInitAttribute
is added in .NET 5, which places it into a similar "bucket" asSupportedOSPlatformAttribute
(da12df4, a33084b), which we had to disable in 00862ad.We likely can't emit
SkipLocalsInitAttribute
until we can emitSupportedOSPlatformAttribute
.The text was updated successfully, but these errors were encountered: