Skip to content

Add a Selector.GetHandle overload that takes a ReadOnlySpan<byte> #17630

Open
@rolfbjarne

Description

@rolfbjarne

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    dotnet-external-dependency.NET: this issue/pull request is blocked on external workenhancementThe issue or pull request is an enhancement

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions