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
{{ message }}
Repository navigation
[browser][JSImport] Support for marshaling Memory<> #97381
I'd be interested in implementing this. Would this require any special consideration or can we just line up the implementation with Span and ArraySegment?
Other than that, I think the experience would be similar to ArraySegment because JS side would have to hold it pinned via GCHandleType.Pinned same as ArraySegment.
We probably want to do ReadOnlyMemory<T> at the same time.
Which would not have write functions on JS side and new public IReadOnlyMemoryView typescript interface.
Activity
eeegs commentedon Jan 24, 2024
The extra types being discussed in #97380 should be included too.
ArcadeMode commentedon Jan 26, 2026
I'd be interested in implementing this. Would this require any special consideration or can we just line up the implementation with Span and ArraySegment?
pavelsavara commentedon Jan 27, 2026
It will require API proposal for the C# side of the API.
runtime/src/libraries/System.Runtime.InteropServices.JavaScript/ref/System.Runtime.InteropServices.JavaScript.cs
Lines 300 to 311 in 061f153
The JS side API design is not so formal and our team would do it on the PR review.
runtime/src/native/libs/Common/JavaScript/types/public-api.ts
Line 702 in 061f153
Other than that, I think the experience would be similar to
ArraySegmentbecause JS side would have to hold it pinned viaGCHandleType.Pinnedsame asArraySegment.We probably want to do
ReadOnlyMemory<T>at the same time.Which would not have write functions on JS side and new public
IReadOnlyMemoryViewtypescript interface.pavelsavara commentedon Jan 27, 2026
I think that this could be separate effort.