-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
Add overload of ByteString.CopyTo that can copy a slice #6230
Add overload of ByteString.CopyTo that can copy a slice #6230
Conversation
What is the use case?
|
I'll move toward that over time. In this case I'm working in a net472 codebase, the .Span property is not visible in this case, so I was optimizing for what was available to minimize copies. |
@jtattermusch Memory only supported on netcore2.1+. I'd prefer to get this change in for downlevel net472 optimization. |
I guess it comes down that "unity" discussion again; i.e. if "unity" is a supported target, what TFM does "unity" consume? if it is netstandard1.*, then: great - no harm, no foul; if it is net45 then it gets into that awkward spot of
|
Marc's given a better response than I would have done, basically :) |
The current version of unity supports both net45 and netstandard2.0, so both TFM targets can be consumed by unity users and it depends on them what they choose.
|
@jtattermusch Can you clarify the result of the thread above? Do I need to add #if for a net45 target, or is this PR acceptable as-is? |
Closing in deference to a possible re-do as expansion of #5835 to a net45 target. |
I think the plan is to make Google.Protobuf depend on System.Memory for all targets (see #6317 which is currently blocked on some nugets being released as stable) and with that everyone will be able to access the data with byteString.Span property (without needing an additional CopyTo method). |
No description provided.