Comments (4)
I think its definitely correct to change setAll() since it says in the 'masks' field doc comments
the padding bits must be zeroed .
In my PR yesterday I changed iterator() to skip the padding bits. But now, I think that shouldn't be necessary since the padding bits should never be set. And if the user sets them, thats on them. This would make count() and iterator() consistent again whether or not any padding bits are set. So I'm going to revert the iterator() changes from my PR.
from zig.
Which means that setAll is setting the bits of the set differently than how initFull sets them.
Would you agree that the solution is to make setAll()
and unsetAll()
only set bits from 0..self.bit_length
? Currently these set all masks which means 1 full mask of 64 bits being set in the code above instead of only bits 0..19.
I just wanted to see if others agree before making any changes.
from zig.
After looking at the DynamicBitSetUnmanaged code, I think that there are 2 problems. The first is that setAll() shouldn't change the padding bits. And second is that iterator() shouldn't include padding bits.
from zig.
After looking at the DynamicBitSetUnmanaged code, I think that there are 2 problems. The first is that setAll() shouldn't change the padding bits. And second is that iterator() shouldn't include padding bits.
Either change would fix my issue, I was leaning more towards setAll not changing the padding bits because initFull already had that behaviour. And I was unsure if changing the iterator to verify the length might impact performance.
I'm new to zig though, so I trust everyone elses judgement on this matter ^^
from zig.
Related Issues (20)
- Compiler allows initialisation of enum types with invalid enum Values HOT 1
- Runtime safety check added in comptime block HOT 2
- Cannot `@cImport` `windows.h` when targetting `msvc` abi HOT 6
- Errdefer payload type doesn't match function signature
- `callconv(.Naked)` functions with parameters cause silent LLVM crash when compiling for PowerPC
- default local cache directory to `.zig-cache` instead of `zig-cache` HOT 4
- std.debug.bufPrintZ padding on the wrong side of output
- observed error.Unexpected NTSTATUS=0xc0000056 (DELETE_PENDING) in makeOpenDirAccessMaskW
- add `math.approxEqUlp` for numerical precision testing
- Missing error for runtime `@ptrFromInt` to comptime-only type HOT 2
- ReleaseSafe panic error trace points at line 0 when freeing an undefined pointer HOT 4
- Zig does not report errors or sliently fails on `.S` / `assembler_with_cpp` files
- Can't link on PPC64LE HOT 1
- ErrorUnion typeInfo debug print causes GenericPoison HOT 2
- @cInclude("stdio.h") doesn't work for -Dtarget=wasm32-emscripten
- Unsure how to handle duplicate symbol linker error
- SIGTRAP When attempting to write to a runtime index in comptime variable HOT 1
- Undefined struct fields are initialized to 0 instead of 0xAA in debug mode (with llvm backend)
- zig fetch -h should include examples
- Zig build system incorrectly parses some depfiles generated by Rust on Windows
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zig.