group/pintos/src/lib/kernel/bitmap.c
/* Returns true if any bits in B between START and START + CNT,
   exclusive, are set to VALUE, and false otherwise. */
Returns true if any bits in B between START and START + CNT,
exclusive, are set to VALUE, and false otherwise.
Returns true if any bits in B between START and START + CNT exclusive are set to VALUE and false otherwise .
bool
bitmap_contains (const struct bitmap *b, size_t start, size_t cnt, bool value)
{
  size_t i;
  ASSERT (b != NULL);
  ASSERT (start <= b->bit_cnt);
  ASSERT (start + cnt <= b->bit_cnt);
  for (i = 0; i < cnt; i++)
    if (bitmap_test (b, start + i) == value)
      return true;
  return false;
}
bool bitmap_contains ( const struct bitmap * b , size_t start , size_t cnt , bool value ) { size_t i ; ASSERT ( b != NULL ) ; ASSERT ( start <= b -> bit_cnt ) ; ASSERT ( start + cnt <= b -> bit_cnt ) ; for ( i = 0 ; i < cnt ; i ++ ) if ( bitmap_test ( b , start + i ) == value ) return true ; return false ; }
Returns true if any bits in B between START and START + CNT,
exclusive, are set to VALUE, and false otherwise.
Returns true if any bits in B between START and START + CNT exclusive are set to VALUE and false otherwise .