RFR: 8186166: Generalize Atomic::cmpxchg with templates

Andrew Haley aph at redhat.com
Fri Aug 18 13:23:40 UTC 2017


This hunk was missing the parameter declaration of order.  Fixed thusly:

diff -r 214a94e9366c src/os_cpu/linux_aarch64/vm/atomic_linux_aarch64.hpp
--- a/src/os_cpu/linux_aarch64/vm/atomic_linux_aarch64.hpp	Mon Jul 17 12:11:32 2017 +0000
+++ b/src/os_cpu/linux_aarch64/vm/atomic_linux_aarch64.hpp	Fri Aug 18 14:22:19 2017 +0100
@@ -85,9 +85,12 @@
                            (volatile intptr_t*) dest);
 }

-template <typename T> T generic_cmpxchg(T exchange_value, volatile T* dest,
-                                        T compare_value, cmpxchg_memory_order order)
-{
+template<size_t byte_size>
+template<typename T>
+inline T Atomic::PlatformCmpxchg<byte_size>::operator()(T exchange_value,
+                                                        T volatile* dest,
+                                                        T compare_value,
+                                                        cmpxchg_memory_order order) const {
   if (order == memory_order_relaxed) {
     T value = compare_value;
     __atomic_compare_exchange(dest, &value, &exchange_value, /*weak*/false,
@@ -98,17 +101,6 @@
   }
 }



-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the hotspot-dev mailing list