Added support for Span<T>/ReadOnlySpan<T> in net40 #68
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes the net40 target so it supports key features in
which can significantly reduce allocations when used. All of the features in these libraries can now be utilized without conditionally compiling. It also means that the ref struct
ValueStringBuilder
can now be utilized on net40 as well, further reducing conditional compilation.This PR does not (yet) remove the conditional compilation. But with this in place, we can remove:
FEATURE_SPAN
FEATURE_ARRAYPOOL
ReadOnlySpan<char>
andMemory<char>
ReadOnlySpan<char>
andMemory<char>
ICharSequence
overloads that acceptchar[]
,StringBuilder
, andICharSequence
The plan is to use
ReadOnlySpan<char>
to replace the Java-likeICharSequence
in most places. Where the stack is not available (types that would be difficult to convert to ref structs), we can useReadOnlyMemory<char>
. To match the BCL, we will provide overloads that accept string that simply cascade the call to theReadOnlySpan<char>
orReadOnlyMemory<char>
implementation.StringBuilder
internally will be replaced withValueStringBuilder
, which is readily convertible toReadOnlySpan<char>
.This PR also disables the tests that require IKVM and removes the reference, since it no longer compiles. This will need to be revisited again at some point.