Skip to content

Commit

Permalink
Remove redudant local
Browse files Browse the repository at this point in the history
  • Loading branch information
robehn committed Sep 26, 2023
1 parent 92782cb commit 6e5545a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/hotspot/os_cpu/linux_riscv/atomic_linux_riscv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,17 @@ inline T Atomic::PlatformCmpxchg<byte_size>::operator()(T volatile* dest __attri
T exchange_value,
atomic_memory_order order) const {
STATIC_ASSERT(byte_size == sizeof(T));
T value = compare_value;
if (order != memory_order_relaxed) {
FULL_MEM_BARRIER;
}

__atomic_compare_exchange(dest, &value, &exchange_value, /* weak */ false,
__atomic_compare_exchange(dest, &compare_value, &exchange_value, /* weak */ false,
__ATOMIC_RELAXED, __ATOMIC_RELAXED);

if (order != memory_order_relaxed) {
FULL_MEM_BARRIER;
}
return value;
return compare_value;
}

template<size_t byte_size>
Expand Down

0 comments on commit 6e5545a

Please sign in to comment.