equal
deleted
inserted
replaced
59 |
59 |
60 private: |
60 private: |
61 bm_word_t* _map; // First word in bitmap |
61 bm_word_t* _map; // First word in bitmap |
62 idx_t _size; // Size of bitmap (in bits) |
62 idx_t _size; // Size of bitmap (in bits) |
63 |
63 |
|
64 // Helper for get_next_{zero,one}_bit variants. |
|
65 // - flip designates whether searching for 1s or 0s. Must be one of |
|
66 // find_{zeros,ones}_flip. |
|
67 // - aligned_right is true if r_index is a priori on a bm_word_t boundary. |
|
68 template<bm_word_t flip, bool aligned_right> |
|
69 inline idx_t get_next_bit_impl(idx_t l_index, idx_t r_index) const; |
|
70 |
|
71 // Values for get_next_bit_impl flip parameter. |
|
72 static const bm_word_t find_ones_flip = 0; |
|
73 static const bm_word_t find_zeros_flip = ~(bm_word_t)0; |
|
74 |
64 protected: |
75 protected: |
65 // Return the position of bit within the word that contains it (e.g., if |
76 // Return the position of bit within the word that contains it (e.g., if |
66 // bitmap words are 32 bits, return a number 0 <= n <= 31). |
77 // bitmap words are 32 bits, return a number 0 <= n <= 31). |
67 static idx_t bit_in_word(idx_t bit) { return bit & (BitsPerWord - 1); } |
78 static idx_t bit_in_word(idx_t bit) { return bit & (BitsPerWord - 1); } |
68 |
79 |