-
-/* Returns the number of bits in B between START and END,
- exclusive, that are set to VALUE. */
-size_t
-bitmap_count (const struct bitmap *b, size_t start, size_t end, bool value)
-{
- size_t idx, cnt;
-
- ASSERT (b != NULL);
- ASSERT (start <= end);
- ASSERT (end <= b->bit_cnt);
-
- cnt = 0;
- for (idx = start; idx < end; idx++)
- cnt += bitmap_test (b, idx) == value;
- return cnt;
-}
-
-/* Returns true if any bits in B between START and END,
- exclusive, are set to true, and false otherwise.*/
-bool
-bitmap_any (const struct bitmap *b, size_t start, size_t end)
-{
- return contains (b, start, end, true);
-}
-
-/* Returns true if no bits in B between START and END, exclusive,
- are set to true, and false otherwise.*/
-bool
-bitmap_none (const struct bitmap *b, size_t start, size_t end)
-{
- return !contains (b, start, end, true);
-}
-
-/* Returns true if every bit in B between START and END,
- exclusive, is set to true, and false otherwise. */
-bool
-bitmap_all (const struct bitmap *b, size_t start, size_t end)
-{
- return !contains (b, start, end, false);
-}