< prev index next >

src/os_cpu/linux_zero/vm/atomic_linux_zero.hpp

Print this page
rev 13452 : [mq]: coleen_review1
rev 13458 : imported patch cmpxchg_using_helper

*** 269,283 **** template<typename T> inline T Atomic::PlatformCmpxchg<4>::operator()(T exchange_value, T volatile* dest, T compare_value, cmpxchg_memory_order order) { #ifdef ARM ! return cmpxchg_using_stub<int>(arm_compare_and_swap, exchange_value, dest, compare_value); #else #ifdef M68K ! return cmpxchg_using_stub<int>(m68k_compare_and_swap, exchange_value, dest, compare_value); #else return __sync_val_compare_and_swap(dest, compare_value, exchange_value); #endif // M68K #endif // ARM } --- 269,284 ---- template<typename T> inline T Atomic::PlatformCmpxchg<4>::operator()(T exchange_value, T volatile* dest, T compare_value, cmpxchg_memory_order order) { + STATIC_ASSERT(4 == sizeof(T)); #ifdef ARM ! return cmpxchg_using_helper<int>(arm_compare_and_swap, exchange_value, dest, compare_value); #else #ifdef M68K ! return cmpxchg_using_helper<int>(m68k_compare_and_swap, exchange_value, dest, compare_value); #else return __sync_val_compare_and_swap(dest, compare_value, exchange_value); #endif // M68K #endif // ARM }
*** 286,295 **** --- 287,297 ---- template<typename T> inline T Atomic::PlatformCmpxchg<8>::operator()(T exchange_value, T volatile* dest, T compare_value, cmpxchg_memory_order order) { + STATIC_ASSERT(8 == sizeof(T)); return __sync_val_compare_and_swap(dest, compare_value, exchange_value); } inline jlong Atomic::load(const volatile jlong* src) { volatile jlong dest;
< prev index next >