-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking: Revisit APIs to use Span<T> #19444
Comments
@karelz why this not under System.Runtime area? |
I expected it to be cross-cutting. It will also grow. I don't have strong preference between Meta vs. Runtime in this case. |
@karelz If you have |
@karelz, I think it may also be valuable offering an API for converting an public struct ImmutableArray<T>
{
public static implicit operator ReadOnlySpan<T>(ImmutableArray<T> array);
}
|
Updated above ... |
I wonder when the right time to make |
cc: @jkotas @terrajobst |
System.Memory for .NET Framework will be separate nuget package for foreseeable future.
Right. The current solution to this problem is this hack: https://github.com/dotnet/corefx/blob/master/src/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/ImmutableByteArrayInterop.cs#L83 that is getting replicated around. There was a discussion about adding official method to get to the underlying storage to avoid this hack, but the purist view of not having such method in the public surface prevailed. I believe this discussion was before open source, so it is not on GitHub. (disclaimer: I was for adding the method).
|
@jkotas Thanks for the synopsis. Very interesting to know the background on all of this. |
Stream.Read/Write[Async] |
Did we also forget about the IO APIs? https://github.com/dotnet/corefx/issues/6740#issuecomment-253602220 |
Top post updated with both @geoffkizer's and @jamesqo's links. |
What about Crypto API's? |
Top post updated, thanks @Drawaes! |
We just need to wait for
Span<T>
to mature a bit.Int32.Parse
,Int32.TryParse
Parse
on all primitive types (sbyte.Parse
byte.Parse
short.Parse
...ulong.Parse
,DateTime.Parse
,Guid.Parse
, etc)StringBuilder.Append
ImmutableArray<T>.implicit operator ReadOnlySpan<T>()
string.Split
Guid.GetBytes(out byte[])
,Decimal.GetBits(decimal, out byte[])
out byte[]
)Encoding.GetBytes
SocketAsyncEventArgs.SetBuffer(Memory<T>)
Stream.Read/Write[Async]
andSocket.Send/Receive[Async]
IPAddress
ImmutableArray.AsReadOnlySpan()
The text was updated successfully, but these errors were encountered: