68 |
68 |
69 template<size_t byte_size> |
69 template<size_t byte_size> |
70 struct Atomic::PlatformAdd |
70 struct Atomic::PlatformAdd |
71 : Atomic::AddAndFetch<Atomic::PlatformAdd<byte_size> > |
71 : Atomic::AddAndFetch<Atomic::PlatformAdd<byte_size> > |
72 { |
72 { |
73 template<typename I, typename D> |
73 template<typename D, typename I> |
74 D add_and_fetch(I add_value, D volatile* dest, atomic_memory_order order) const; |
74 D add_and_fetch(D volatile* dest, I add_value, atomic_memory_order order) const; |
75 }; |
75 }; |
76 |
76 |
77 template<> |
77 template<> |
78 template<typename I, typename D> |
78 template<typename D, typename I> |
79 inline D Atomic::PlatformAdd<4>::add_and_fetch(I add_value, D volatile* dest, |
79 inline D Atomic::PlatformAdd<4>::add_and_fetch(D volatile* dest, I add_value, |
80 atomic_memory_order order) const { |
80 atomic_memory_order order) const { |
81 STATIC_ASSERT(4 == sizeof(I)); |
81 STATIC_ASSERT(4 == sizeof(I)); |
82 STATIC_ASSERT(4 == sizeof(D)); |
82 STATIC_ASSERT(4 == sizeof(D)); |
83 return add_using_helper<int32_t>(os::atomic_add_func, add_value, dest); |
83 return add_using_helper<int32_t>(os::atomic_add_func, dest, add_value); |
84 } |
84 } |
85 |
85 |
86 |
86 |
87 template<> |
87 template<> |
88 template<typename T> |
88 template<typename T> |