[Bf-blender-cvs] [28b2977] master: Atomic operations: Add function declarations at the top of the header

Sergey Sharybin noreply at git.blender.org
Wed May 20 08:58:49 CEST 2015


Commit: 28b2977be98c71ceaf9f36ddba406392b50a46c9
Author: Sergey Sharybin
Date:   Wed May 20 11:57:17 2015 +0500
Branches: master
https://developer.blender.org/rB28b2977be98c71ceaf9f36ddba406392b50a46c9

Atomic operations: Add function declarations at the top of the header

No functional changes, just helps grasping what operations are actually
supported.

===================================================================

M	intern/atomic/atomic_ops.h

===================================================================

diff --git a/intern/atomic/atomic_ops.h b/intern/atomic/atomic_ops.h
index 06a5c8d..15a77e4 100644
--- a/intern/atomic/atomic_ops.h
+++ b/intern/atomic/atomic_ops.h
@@ -77,6 +77,27 @@
 #  define LG_SIZEOF_INT 2
 #endif
 
+/************************/
+/* Function prototypes. */
+
+#if (LG_SIZEOF_PTR == 3 || LG_SIZEOF_INT == 3)
+ATOMIC_INLINE uint64_t atomic_add_uint64(uint64_t *p, uint64_t x);
+ATOMIC_INLINE uint64_t atomic_sub_uint64(uint64_t *p, uint64_t x);
+ATOMIC_INLINE uint64_t atomic_cas_uint64(uint64_t *v, uint64_t old, uint64_t _new);
+#endif
+
+ATOMIC_INLINE uint32_t atomic_add_uint32(uint32_t *p, uint32_t x);
+ATOMIC_INLINE uint32_t atomic_sub_uint32(uint32_t *p, uint32_t x);
+ATOMIC_INLINE uint32_t atomic_cas_uint32(uint32_t *v, uint32_t old, uint32_t _new);
+
+ATOMIC_INLINE size_t atomic_add_z(size_t *p, size_t x);
+ATOMIC_INLINE size_t atomic_sub_z(size_t *p, size_t x);
+ATOMIC_INLINE size_t atomic_cas_z(size_t *v, size_t old, size_t _new);
+
+ATOMIC_INLINE unsigned atomic_add_u(unsigned *p, unsigned x);
+ATOMIC_INLINE unsigned atomic_sub_u(unsigned *p, unsigned x);
+ATOMIC_INLINE unsigned atomic_cas_u(unsigned *v, unsigned old, unsigned _new);
+
 /******************************************************************************/
 /* 64-bit operations. */
 #if (LG_SIZEOF_PTR == 3 || LG_SIZEOF_INT == 3)




More information about the Bf-blender-cvs mailing list