119 inline void BitMap::set_range_of_words(idx_t beg, idx_t end) { |
119 inline void BitMap::set_range_of_words(idx_t beg, idx_t end) { |
120 bm_word_t* map = _map; |
120 bm_word_t* map = _map; |
121 for (idx_t i = beg; i < end; ++i) map[i] = ~(bm_word_t)0; |
121 for (idx_t i = beg; i < end; ++i) map[i] = ~(bm_word_t)0; |
122 } |
122 } |
123 |
123 |
|
124 inline void BitMap::clear_range_of_words(bm_word_t* map, idx_t beg, idx_t end) { |
|
125 for (idx_t i = beg; i < end; ++i) map[i] = 0; |
|
126 } |
124 |
127 |
125 inline void BitMap::clear_range_of_words(idx_t beg, idx_t end) { |
128 inline void BitMap::clear_range_of_words(idx_t beg, idx_t end) { |
126 bm_word_t* map = _map; |
129 clear_range_of_words(_map, beg, end); |
127 for (idx_t i = beg; i < end; ++i) map[i] = 0; |
130 } |
128 } |
|
129 |
|
130 |
131 |
131 inline void BitMap::clear() { |
132 inline void BitMap::clear() { |
132 clear_range_of_words(0, size_in_words()); |
133 clear_range_of_words(0, size_in_words()); |
133 } |
134 } |
134 |
|
135 |
135 |
136 inline void BitMap::par_clear_range(idx_t beg, idx_t end, RangeSizeHint hint) { |
136 inline void BitMap::par_clear_range(idx_t beg, idx_t end, RangeSizeHint hint) { |
137 if (hint == small_range && end - beg == 1) { |
137 if (hint == small_range && end - beg == 1) { |
138 par_at_put(beg, false); |
138 par_at_put(beg, false); |
139 } else { |
139 } else { |
357 _map.at_put(bit_index(slot_index, bit_within_slot_index), value); |
357 _map.at_put(bit_index(slot_index, bit_within_slot_index), value); |
358 } |
358 } |
359 |
359 |
360 inline void BitMap2D::at_put_grow(idx_t slot_index, idx_t bit_within_slot_index, bool value) { |
360 inline void BitMap2D::at_put_grow(idx_t slot_index, idx_t bit_within_slot_index, bool value) { |
361 verify_bit_within_slot_index(bit_within_slot_index); |
361 verify_bit_within_slot_index(bit_within_slot_index); |
362 _map.at_put_grow(bit_index(slot_index, bit_within_slot_index), value); |
362 |
|
363 idx_t bit = bit_index(slot_index, bit_within_slot_index); |
|
364 if (bit >= _map.size()) { |
|
365 _map.resize(2 * MAX2(_map.size(), bit)); |
|
366 } |
|
367 _map.at_put(bit, value); |
363 } |
368 } |
364 |
369 |
365 inline void BitMap2D::clear() { |
370 inline void BitMap2D::clear() { |
366 _map.clear(); |
371 _map.clear(); |
367 } |
372 } |