Skip to content

Reference System.Memory and use it in math/raw #569

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Rob-Hague
Copy link
Contributor

Describe your changes

This change represents an initial/example contribution towards #550. It adds a reference to System.Memory and uses it to deduplicate a number of internal code paths.

The change is kept isolated to one directory (src/math/raw) for sympathy with review. If this change is accepted, there is more that can be done in other layers of the library.

This also adds a reference to System.ValueTuple on net461 and a private reference to PolySharp. These are not necessary but allow using Index/Range syntax on lower targets.

How has this been tested?

Existing unit tests

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have kept the patch limited to only change the parts related to the patch
  • This change requires a documentation update

See also Contributing Guidelines.

@@ -6,6 +6,7 @@
<AssemblyOriginatorKeyFile>..\..\BouncyCastle.NET.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<NoWarn>1591</NoWarn>
<LangVersion>10.0</LangVersion>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only needed for Index/Range syntax

Comment on lines +95 to +97
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only needed for Index/Range syntax

Comment on lines +112 to +115
<PackageReference Include="PolySharp" Version="1.14.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only needed for Index/Range syntax

@uniblab
Copy link

uniblab commented May 5, 2025

I like updates which have more BALEETED than add. The code we don't have is code we don't need to maintain 💯

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants