microsoft / microsoft/CsWinRT

Question: Is there any planned support for Memory<> and Span<>?

Open
#824 1 comment 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

AssemblyVersion change enhancement performance question
Dominant language
C#
Stars
665
Forks
134
Avg merge
1d 3h
Merged PRs (30d)
32

Description

Hi all,

I'm creating an API with IDL 3 that has the following signature (or a similar one):
void Process(UInt8[] value);

With C++/WinRT (2.0.210403.2) I have a nice array_view API:
void Process(array_view<uint8_t> value);
This allows to support many data types with no overhead.

With C#/WinRT (1.2.5) I have an Array API:
void Process(byte[] value);
This version does not allow us to pass Memory<byte> or Span<byte> that we use in other parts of our application. We may need to create a somewhat useless temporary array.

Do you have plan for Memory<T> and Span<T> support instead of T[]?

Regards,
Guillaume

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue discusses C#/WinRT IDL 3 array projection, comparing byte[] with C++/WinRT array_view; it names no files, tests, or entry points. Start by locating the existing T[] projection and its tests, but a maintainer would first need to define the design and acceptance criteria for Memory and Span support.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.