mirrored from https://www.bouncycastle.org/repositories/bc-csharp
-
Notifications
You must be signed in to change notification settings - Fork 555
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
Consider referencing System.Memory #550
Comments
@peterdettman would you be open to this? Happy to get it started. As it's a big job, it can be done in pieces starting in the lower levels of the library. It's also possible to keep the Index/Range syntax using a polyfill of those types and a reference to System.ValueTuple on net461. |
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Perhaps you've already considered it, but in case you haven't:
The library has many duplicate code paths, one using a Span implementation for higher targets (.NET) and one using arrays for lower targets (.NET Framework and .NET Standard 2.0)
Microsoft provide (and support) the System.Memory package, which allows use of Span etc. on .NET Framework and .NET Standard 2.0. It is fairly common for multi-targeting libraries to reference the package on lower targets. The source code is at https://github.com/dotnet/maintenance-packages/tree/main/src/System.Memory.
This reference would allow many code paths (and public API) to be unified.
Practically, the initial change would look like:
Example unified diff (note Index/Range operators
[..32]
not supported):The text was updated successfully, but these errors were encountered: