[m-rev.] trivial diff: Add a comment to runtime/mercury_atomic_ops.h

Paul Bone pbone at csse.unimelb.edu.au
Tue Jun 22 09:54:26 AEST 2010


Add a comment warning programmers against using the atomic functions with C's
native integers.

runtime/mercury_atomic_ops.h:
    As above.

Index: runtime/mercury_atomic_ops.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_atomic_ops.h,v
retrieving revision 1.15
diff -u -p -b -r1.15 mercury_atomic_ops.h
--- runtime/mercury_atomic_ops.h	20 Mar 2010 10:15:51 -0000	1.15
+++ runtime/mercury_atomic_ops.h	24 Mar 2010 01:52:12 -0000
@@ -65,6 +65,11 @@
 
 /*
 ** Declarations for inline atomic operations.
+**
+** These operations work on machine word-sized values, this is distinct from
+** C's idea of 'int' and 'unsigned int'.  MR_Integer and MR_Unsigned are
+** supposed to be machine word sized so these functions should only be used
+** with values of these types.
 */
 
 /*
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 489 bytes
Desc: Digital signature
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20100622/02b701dd/attachment.sig>


More information about the reviews mailing list