Open
Description
We'd like to add a Selector.GetHandle
overload that takes a ReadOnlySpan<byte>
:
public extern static IntPtr GetHandle (/* const char* */ ReadOnlySpan<byte> name);
where the name
argument is a UTF8 string, used like this:
Selector.GetHandle ("mySelector"u8);
Note that UTF8 literals were introduced in C# 11, shipped with .NET 7, so this would not include support in legacy Xamarin.
The main problem is that the AOT compiler is optimizing calls to Selector.GetHandle, and the current code doesn't take arguments into account, so we'll break the AOT compiler by adding another overload - thus we need support in the AOT compiler first: dotnet/runtime#82717