1 --- bitmap.c.~1.5.~ 2004-10-06 14:29:56.000000000 -0700
2 +++ bitmap.c 2004-11-03 14:35:22.000000000 -0800
10 #include "threads/malloc.h"
11 @@ -212,14 +213,25 @@ size_t
12 bitmap_scan (const struct bitmap *b, size_t start, size_t cnt, bool value)
18 ASSERT (start <= b->bit_cnt);
20 for (idx = start, last = b->bit_cnt - cnt; idx <= last; idx++)
21 if (!contains (b, idx, idx + cnt, !value))
24 + return BITMAP_ERROR;
27 + m = random_ulong () % n;
29 + for (idx = start, last = b->bit_cnt - cnt; idx <= last; idx++)
30 + if (!contains (b, idx, idx + cnt, !value) && m-- == 0)
32 - return BITMAP_ERROR;
37 /* Finds the first group of CNT consecutive bits in B at or after