8270347: ZGC: Adopt release-acquire ordering for forwarding table access

Co-authored-by: Hao Tang <albert.th@alibaba-inc.com>
Reviewed-by: eosterlund, pliden
This commit is contained in:
Xiaowei Lu 2021-08-03 12:23:14 +00:00 committed by Per Liden
parent b217a6ca0f
commit bdb50cab79

View File

@ -137,7 +137,7 @@ inline uintptr_t ZForwarding::insert(uintptr_t from_index, uintptr_t to_offset,
const ZForwardingEntry old_entry; // Empty
for (;;) {
const ZForwardingEntry prev_entry = Atomic::cmpxchg(entries() + *cursor, old_entry, new_entry);
const ZForwardingEntry prev_entry = Atomic::cmpxchg(entries() + *cursor, old_entry, new_entry, memory_order_release);
if (!prev_entry.populated()) {
// Success
return to_offset;