< prev index next >

src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.hpp

Print this page
rev 13452 : [mq]: coleen_review1

@@ -99,10 +99,11 @@
 template<typename T>
 inline T Atomic::PlatformCmpxchg<4>::operator()(T exchange_value,
                                                 T volatile* dest,
                                                 T compare_value,
                                                 cmpxchg_memory_order order) const {
+  STATIC_ASSERT(4 == sizeof(T));
   T rv;
   __asm__ volatile(
     " cas    [%2], %3, %0"
     : "=r" (rv)
     : "0" (exchange_value), "r" (dest), "r" (compare_value)

@@ -114,10 +115,11 @@
 template<typename T>
 inline T Atomic::PlatformCmpxchg<8>::operator()(T exchange_value,
                                                 T volatile* dest,
                                                 T compare_value,
                                                 cmpxchg_memory_order order) const {
+  STATIC_ASSERT(8 == sizeof(T));
   T rv;
   __asm__ volatile(
     " casx   [%2], %3, %0"
     : "=r" (rv)
     : "0" (exchange_value), "r" (dest), "r" (compare_value)
< prev index next >