mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8039042: G1: Phantom zeros in cardtable
Reviewed-by: tschatzl, mgerdin
This commit is contained in:
parent
92baa3214c
commit
eddf95338d
1 changed files with 9 additions and 1 deletions
|
@ -96,7 +96,15 @@ void G1SATBCardTableModRefBS::g1_mark_as_young(const MemRegion& mr) {
|
|||
jbyte *const first = byte_for(mr.start());
|
||||
jbyte *const last = byte_after(mr.last());
|
||||
|
||||
memset(first, g1_young_gen, last - first);
|
||||
// Below we may use an explicit loop instead of memset() because on
|
||||
// certain platforms memset() can give concurrent readers phantom zeros.
|
||||
if (UseMemSetInBOT) {
|
||||
memset(first, g1_young_gen, last - first);
|
||||
} else {
|
||||
for (jbyte* i = first; i < last; i++) {
|
||||
*i = g1_young_gen;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue