1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use Bitfield;
use iter;
/// Iterate over a `Bitfield` instance.
// TODO: the most efficient way to iterate this is to get a page at the time &
// cache it. Then get a bit at the time & cache it. That should allow us to
// return values much faster, rather than doing a heap lookup for every bit.
//
// The CPU's (L3) cache might kick in here to store a page at the time, but
// there's no guarantees that it does. So it's up to us to eventually optimize
// this.