< prev index next >

src/os_cpu/linux_aarch64/vm/atomic_linux_aarch64.hpp

Print this page
rev 13452 : imported patch Atomic_cmpxchg
rev 13453 : imported patch Atomic_add

@@ -45,14 +45,19 @@
 inline void Atomic::store    (jint     store_value, volatile jint*     dest) { *dest = store_value; }
 inline void Atomic::store_ptr(intptr_t store_value, volatile intptr_t* dest) { *dest = store_value; }
 inline void Atomic::store_ptr(void*    store_value, volatile void*     dest) { *(void* volatile *)dest = store_value; }
 
 
-inline jint Atomic::add(jint add_value, volatile jint* dest)
+template<size_t byte_size>
+struct Atomic::PlatformAdd
+  : Atomic::AddAndFetch<Atomic::PlatformAdd<byte_size> >
 {
+  template<typename I, typename D>
+  D add_and_fetch(I add_value, D volatile* dest) const {
  return __sync_add_and_fetch(dest, add_value);
-}
+  }
+};
 
 inline void Atomic::inc(volatile jint* dest)
 {
  add(1, dest);
 }

@@ -103,20 +108,10 @@
 }
 
 inline void Atomic::store (jlong store_value, jlong* dest) { *dest = store_value; }
 inline void Atomic::store (jlong store_value, volatile jlong* dest) { *dest = store_value; }
 
-inline intptr_t Atomic::add_ptr(intptr_t add_value, volatile intptr_t* dest)
-{
- return __sync_add_and_fetch(dest, add_value);
-}
-
-inline void* Atomic::add_ptr(intptr_t add_value, volatile void* dest)
-{
-  return (void *) add_ptr(add_value, (volatile intptr_t *) dest);
-}
-
 inline void Atomic::inc_ptr(volatile intptr_t* dest)
 {
  add_ptr(1, dest);
 }
 
< prev index next >