Skip to content
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

std.DynamicBitSetUnmanaged: respect padding bits #19945

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

Conversation

travisstaloch
Copy link
Contributor

@travisstaloch travisstaloch commented May 11, 2024

EDITED

closes #19933

This patch makes setAll() preserve padding bits.

DynamicBitSetUnmanaged depends on its padding bits being zeroed as
stated in the 'masks' field's doc comments. but setAll() was setting
all masks, including the padding, to ones.

closes ziglang#19933

This patch makes setAll() preserve padding bits.

DynamicBitSetUnmanaged depends on its padding bits being zeroed as
stated in the 'masks' field's doc comments.  but setAll() was setting
all masks, including the padding, to ones.
@nurpax
Copy link
Contributor

nurpax commented Dec 22, 2024

The PR 22289 mentioned above adds unsetAll() which IMO is pretty commonly needed. Of course it can be accessed through bitset.unmanaged but that's inconsistent with a bunch of other methods that have a wrapper that calls into unmanaged like isSet(), count(), etc. That PR also fixes the same bug that's fixed here. I don't mind which of these goes in but clearly both of these PRs are improving the DynamicBitSet and not making it worse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants