Lines Matching refs:bits
34 typedef uint64_t *bitarray_t; // array of bits, assumed to be mostly 0
35 typedef uint32_t index_t; // we limit the number of bits to be a 32-bit quantity
41 // For a bitarray with 1<<log_size bits, returns the number of bytes needed to contain the whole bitarray
44 // creates a bitarray with 1<<log_size bits, all initialized to 0.
47 extern bool bitarray_get(bitarray_t bits, unsigned log_size, index_t index);
49 extern bool bitarray_set(bitarray_t bits, unsigned log_size, index_t index);
52 extern bool bitarray_zap(bitarray_t bits, unsigned log_size, index_t index);
55 extern index_t bitarray_first_set(const bitarray_t bits, unsigned log_size);
56 // Returns the index first bit that's 1, plus 1, or 0 if all the bits are zero
58 extern bool bitarray_zap_first_set(bitarray_t bits, unsigned log_size, index_t *index);
61 extern unsigned bitarray_zap_first_set_multiple(bitarray_t bits, unsigned log_size, unsigned max, index_t *indices);
62 // finds all the bits set, up to max, and zaps each and sets the index for each