diff options
author | Ryan Newton <rrnewton@gmail.com> | 2013-08-22 11:43:09 -0400 |
---|---|---|
committer | Ryan Newton <rrnewton@gmail.com> | 2013-08-22 11:43:09 -0400 |
commit | 6fd60b2382efa357fe99fa017fd343db9724d43a (patch) | |
tree | f2dd98aa33d01c14b0d4156549f9df1908cf0b63 | |
parent | 25ad01533aaaf1ccf69e1b7216e66de025b8131b (diff) | |
download | haskell-6fd60b2382efa357fe99fa017fd343db9724d43a.tar.gz |
minor bugfix to casIntArray# and fetchAddIntArray#
-rw-r--r-- | rts/PrimOps.cmm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index a07c1def97..060f5dba98 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; |