You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.class public auto ansi beforefieldinit AccessHelper`1<W>
extends [System.Runtime]System.Object
{
.method public hidebysig static class MyList`1<!W>
CreateSized(int32 n) cil managed
{
.custom instance void [System.Runtime]System.Runtime.CompilerServices.UnsafeAccessorAttribute::.ctor([System.Runtime]System.Runtime.CompilerServices.UnsafeAccessorKind) = ( 01 00 00 00 00 00 00 00 )
} // end of method AccessHelper`1::CreateSized
...
}
After ILStrip:
class public auto ansi beforefieldinit AccessHelper`1<W>
extends [System.Private.CoreLib]System.Object
{
.method public hidebysig static class MyList`1<!W>
CreateSized(int32 A_0) cil managed noinlining
{
.custom instance void [System.Private.CoreLib]System.Runtime.CompilerServices.UnsafeAccessorAttribute::.ctor([System.Private.CoreLib]System.Runtime.CompilerServices.UnsafeAccessorKind) = ( 01 00 00 00 00 00 00 00 )
// Code size 1 (0x1)
.maxstack 8
IL_0000: ret
} // end of method AccessHelper`1::CreateSized
} // end of class AccessHelper`1
This affects UnsafeAccessor support on Apple mobile platforms (both the runtime samples and xamarin-macios use the ILStrip task). related to #89439, #99830
The text was updated successfully, but these errors were encountered:
The reason this affects Mono's [UnsafeAccessor] support is because it is cheaper for us to check "does this method have a body" than to check "does this method have a particular custom attribute". Since the majority of methods have bodies and are not unsafe accessors, we use the has-a-body check to quickly bypass the slow path of working with the custom attribute
If you run the ILStrip task on an assembly that contains an
extern
method that has no body or header, ILStrip adds one back.Original IL:
After ILStrip:
This affects UnsafeAccessor support on Apple mobile platforms (both the runtime samples and xamarin-macios use the ILStrip task). related to #89439, #99830
The text was updated successfully, but these errors were encountered: