A chunk that is all zeros; we don’t represent the zeros explicitly.
A chunk that is all ones; we don’t represent the ones explicitly.
A chunk that has a mix of zeros and ones, which are represented explicitly and densely. It never has all zeros or all ones.
If this is the final chunk there may be excess, unused words. This turns out to be both simpler and have better performance than allocating the minimum number of words, largely because we avoid having to store the length, which would make this type larger. These excess words are always be zero, as are any excess bits in the final in-use word.
The second field is the count of 1s set in the chunk, and must satisfy
0 < count < chunk_domain_size.
The words are within an
Rc because it’s surprisingly common to
duplicate an entire chunk, e.g. in
Mixed chunk is union’d into a
Zeros chunk. When we do need
to modify a chunk we use
other values to be equal, and is used
impl StructuralPartialEq for Chunk
Auto Trait Implementations§
impl RefUnwindSafe for Chunk
impl UnwindSafe for Chunk
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain
repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 16 bytes
Size for each variant:
Zeros: 2 bytes
Ones: 2 bytes
Mixed: 14 bytes