< prev index next >
src/hotspot/share/utilities/bitMap.cpp
Print this page
@@ -215,11 +215,11 @@
bm_word_t* pw = word_addr(beg);
bm_word_t w = *pw;
bm_word_t mr = inverted_bit_mask_for_range(beg, end);
bm_word_t nw = value ? (w | ~mr) : (w & mr);
while (true) {
- bm_word_t res = Atomic::cmpxchg(nw, pw, w);
+ bm_word_t res = Atomic::cmpxchg(pw, w, nw);
if (res == w) break;
w = res;
nw = value ? (w | ~mr) : (w & mr);
}
}
@@ -638,11 +638,11 @@
BitMap::idx_t *table = NEW_C_HEAP_ARRAY(idx_t, 256, mtInternal);
for (uint i = 0; i < 256; i++) {
table[i] = num_set_bits(i);
}
- if (!Atomic::replace_if_null(table, &_pop_count_table)) {
+ if (!Atomic::replace_if_null(&_pop_count_table, table)) {
guarantee(_pop_count_table != NULL, "invariant");
FREE_C_HEAP_ARRAY(idx_t, table);
}
}
}
< prev index next >