[commit: ghc] atomics: minor bugfix to casIntArray# and fetchAddIntArray# (6fd60b2)

git at git.haskell.org git at git.haskell.org
Sat Aug 31 04:15:26 CEST 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : atomics
Link       : http://ghc.haskell.org/trac/ghc/changeset/6fd60b2382efa357fe99fa017fd343db9724d43a/ghc

>---------------------------------------------------------------

commit 6fd60b2382efa357fe99fa017fd343db9724d43a
Author: Ryan Newton <rrnewton at gmail.com>
Date:   Thu Aug 22 11:43:09 2013 -0400

    minor bugfix to casIntArray# and fetchAddIntArray#


>---------------------------------------------------------------

6fd60b2382efa357fe99fa017fd343db9724d43a
 rts/PrimOps.cmm |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm
index a07c1de..060f5db 100644
--- a/rts/PrimOps.cmm
+++ b/rts/PrimOps.cmm
@@ -142,7 +142,8 @@ stg_newAlignedPinnedByteArrayzh ( W_ n, W_ alignment )
 stg_casIntArrayzh( gcptr arr, W_ ind, W_ old, W_ new )
 /* MutableByteArray# s -> Int# -> Int# -> Int# -> State# s -> (# State# s, Int# #) */
 {
-    gcptr p,h;
+    gcptr p;
+    W_ h;
 
     p = arr + SIZEOF_StgArrWords + WDS(ind);
     (h) = ccall cas(p, old, new);
@@ -154,7 +155,8 @@ stg_casIntArrayzh( gcptr arr, W_ ind, W_ old, W_ new )
 stg_fetchAddIntArrayzh( gcptr arr, W_ ind, W_ incr )
 /* MutableByteArray# s -> Int# -> Int# -> State# s -> (# State# s, Int# #) */
 {
-    gcptr p, h;
+    gcptr p;
+    W_ h;
 
     p = arr + SIZEOF_StgArrWords + WDS(ind);
     (h) = ccall atomic_inc(p, incr);
@@ -234,7 +236,7 @@ stg_unsafeThawArrayzh ( gcptr arr )
 
 // RRN: Uses the ticketed approach; see casMutVar
 stg_casArrayzh ( gcptr arr, W_ ind, gcptr old, gcptr new )
-/* MutableArray# s a -> Int# -> a -> a -> State# s -> (# State# s, Int#, a #) */
+/* MutableArray# s a -> Int# -> a -> a -> State# s -> (# State# s, Int#, Any a #) */
 {
     gcptr p, h;
     W_ len;
@@ -317,7 +319,7 @@ stg_newMutVarzh ( gcptr init )
 // changing its pointer identity.  The ticket can then be safely used
 // in future CAS operations.
 stg_casMutVarzh ( gcptr mv, gcptr old, gcptr new )
- /* MutVar# s a -> a -> a -> State# s -> (# State#, Int#, a #) */
+ /* MutVar# s a -> a -> a -> State# s -> (# State#, Int#, Any a #) */
 {
     gcptr h;
 





More information about the ghc-commits mailing list