1 /* |
1 /* |
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
190 void set_range(idx_t beg, idx_t end, RangeSizeHint hint); |
190 void set_range(idx_t beg, idx_t end, RangeSizeHint hint); |
191 void clear_range(idx_t beg, idx_t end, RangeSizeHint hint); |
191 void clear_range(idx_t beg, idx_t end, RangeSizeHint hint); |
192 void par_set_range(idx_t beg, idx_t end, RangeSizeHint hint); |
192 void par_set_range(idx_t beg, idx_t end, RangeSizeHint hint); |
193 void par_clear_range (idx_t beg, idx_t end, RangeSizeHint hint); |
193 void par_clear_range (idx_t beg, idx_t end, RangeSizeHint hint); |
194 |
194 |
195 // It performs the union operation between subsets of equal length |
|
196 // of two bitmaps (the target bitmap of the method and the |
|
197 // from_bitmap) and stores the result to the target bitmap. The |
|
198 // from_start_index represents the first bit index of the subrange |
|
199 // of the from_bitmap. The to_start_index is the equivalent of the |
|
200 // target bitmap. Both indexes should be word-aligned, i.e. they |
|
201 // should correspond to the first bit on a bitmap word (it's up to |
|
202 // the caller to ensure this; the method does check it). The length |
|
203 // of the subset is specified with word_num and it is in number of |
|
204 // bitmap words. The caller should ensure that this is at least 2 |
|
205 // (smaller ranges are not support to save extra checks). Again, |
|
206 // this is checked in the method. |
|
207 // |
|
208 // Atomicity concerns: it is assumed that any contention on the |
|
209 // target bitmap with other threads will happen on the first and |
|
210 // last words; the ones in between will be "owned" exclusively by |
|
211 // the calling thread and, in fact, they will already be 0. So, the |
|
212 // method performs a CAS on the first word, copies the next |
|
213 // word_num-2 words, and finally performs a CAS on the last word. |
|
214 void mostly_disjoint_range_union(BitMap* from_bitmap, |
|
215 idx_t from_start_index, |
|
216 idx_t to_start_index, |
|
217 size_t word_num); |
|
218 |
|
219 |
|
220 // Clearing |
195 // Clearing |
221 void clear_large(); |
196 void clear_large(); |
222 inline void clear(); |
197 inline void clear(); |
223 |
198 |
224 // Iteration support. Returns "true" if the iteration completed, false |
199 // Iteration support. Returns "true" if the iteration completed, false |