Expand description
BitSet (§6.1).
A compact set of non-negative integers, backed by a ReprCVec<u64> of
words. Occupancy is bit i of word i / 64. Nullary in user syntax
(BitSet, no type arg); elements are always Int. Iterable (yields Int).
BitSet is its own GC payload: the words are a Drop vector, so the
descriptor’s drop_value releases them on sweep. Equality/hash are
structural (two bitsets are equal iff they hold the same bits).
The container is a ReprCVec and not a std::Vec because generated code
reads its two leading words inline for bs.contains(x) (ADR-118 part 2);
INLINE_BITSET_SITE is the one value that says where they are.
Structs§
- BitIndex
- A value a
BitSetcan actually hold: non-negative, and small enough that the word vector backing it stays a real allocation. - BitSet
Payload - The
BitSetpayload: a growable vector of 64-bit words. Bitiis in wordi / 64at positioni % 64. The field isDrop.
Constants§
- INLINE_
BITSET_ SITE - The one site generated code may read a
BitSet’s words through (ADR-118 part 2), minted beside the payload forINLINE_VEC_SITE’s reason.
Statics§
- BITSET
- Descriptor for
BitSet(§6.1, TypeId 15). Equatable and hashable (structural over the set of bits), so a BitSet can be a value in another collection.