9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_UTILITIES_BITMAP_INLINE_HPP
26 #define SHARE_UTILITIES_BITMAP_INLINE_HPP
27
28 #include "runtime/atomic.hpp"
29 #include "runtime/orderAccess.hpp"
30 #include "utilities/bitMap.hpp"
31 #include "utilities/count_trailing_zeros.hpp"
32
33 inline void BitMap::set_bit(idx_t bit) {
34 verify_index(bit);
35 *word_addr(bit) |= bit_mask(bit);
36 }
37
38 inline void BitMap::clear_bit(idx_t bit) {
39 verify_index(bit);
40 *word_addr(bit) &= ~bit_mask(bit);
41 }
42
43 inline const BitMap::bm_word_t BitMap::load_word_ordered(const volatile bm_word_t* const addr, atomic_memory_order memory_order) {
44 if (memory_order == memory_order_relaxed || memory_order == memory_order_release) {
45 return Atomic::load(addr);
46 } else {
47 assert(memory_order == memory_order_acq_rel ||
48 memory_order == memory_order_acquire ||
49 memory_order == memory_order_conservative,
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_UTILITIES_BITMAP_INLINE_HPP
26 #define SHARE_UTILITIES_BITMAP_INLINE_HPP
27
28 #include "runtime/atomic.hpp"
29 #include "utilities/bitMap.hpp"
30 #include "utilities/count_trailing_zeros.hpp"
31
32 inline void BitMap::set_bit(idx_t bit) {
33 verify_index(bit);
34 *word_addr(bit) |= bit_mask(bit);
35 }
36
37 inline void BitMap::clear_bit(idx_t bit) {
38 verify_index(bit);
39 *word_addr(bit) &= ~bit_mask(bit);
40 }
41
42 inline const BitMap::bm_word_t BitMap::load_word_ordered(const volatile bm_word_t* const addr, atomic_memory_order memory_order) {
43 if (memory_order == memory_order_relaxed || memory_order == memory_order_release) {
44 return Atomic::load(addr);
45 } else {
46 assert(memory_order == memory_order_acq_rel ||
47 memory_order == memory_order_acquire ||
48 memory_order == memory_order_conservative,
|