Skip to content

Add CollectionsMarshal.AsBytes(BitArray)#116308

Merged
stephentoub merged 5 commits into
dotnet:mainfrom
stephentoub:bitarrayasbytes
Jun 17, 2025
Merged

Add CollectionsMarshal.AsBytes(BitArray)#116308
stephentoub merged 5 commits into
dotnet:mainfrom
stephentoub:bitarrayasbytes

Conversation

@stephentoub

Copy link
Copy Markdown
Member

This entailed:

  • Moving BitArray to corelib
  • Inverting the endianness concerns so that the internal storage is always little endian
  • Avoiding duplication of endianness-related changes by consolidating / deduplicating a bunch of the implementation (in particular around the SIMD implementations of And/Or/Xor/Not).
  • As long as I was touching a bunch of the code, cleaning up some of the antiquated style aspects.

Still need to validate perf and likely fix some big endian issues.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-collections
See info in area-owners.md if you want to be subscribed.

@stephentoub

Copy link
Copy Markdown
Member Author

/azp list

@azure-pipelines

Copy link
Copy Markdown
CI/CD Pipelines for this repository:

@stephentoub

Copy link
Copy Markdown
Member Author

/azp run runtime-community

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Comment thread src/libraries/System.Private.CoreLib/src/System/Collections/BitArray.cs Outdated
@stephentoub

Copy link
Copy Markdown
Member Author

/azp run runtime-community

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@stephentoub

Copy link
Copy Markdown
Member Author

/azp run runtime-community

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@jkotas

jkotas commented Jun 5, 2025

Copy link
Copy Markdown
Member

runtime-community

This does not run tests on big endian machines (disabled due to security). Replacement is being worked on, but it is not online yet.

I see that https://github.com/dotnet/runtime/blob/main/eng/pipelines/runtime-community.yml#L47 is a misleading comment - it does just a build, it does not run any tests. Could you please fix it while you are on it?

Comment thread src/libraries/System.Private.CoreLib/src/System/Collections/BitArray.cs Outdated
@stephentoub stephentoub marked this pull request as ready for review June 9, 2025 17:44
@stephentoub stephentoub requested a review from tannergooding June 9, 2025 17:44
Comment thread src/libraries/System.Private.CoreLib/src/System/Collections/BitArray.cs Outdated
Comment thread src/libraries/System.Private.CoreLib/src/System/Collections/BitArray.cs Outdated
Comment thread src/libraries/System.Private.CoreLib/src/System/Collections/BitArray.cs Outdated
@stephentoub stephentoub merged commit 38c8e8f into dotnet:main Jun 17, 2025
148 of 150 checks passed
@stephentoub stephentoub deleted the bitarrayasbytes branch June 17, 2025 17:13
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants