summaryrefslogtreecommitdiff
path: root/compiler/prelude
diff options
context:
space:
mode:
authorRyan Newton <rrnewton@gmail.com>2012-03-29 00:32:03 -0400
committerRyan Newton <rrnewton@gmail.com>2013-08-21 00:02:29 -0400
commit3ca7ecb57eefc43b4347e22ad2fd7a4962d84020 (patch)
tree7c1251734372615ba791bf355eca6aa4beecdebc /compiler/prelude
parent82bbc3864ff608879cffbe0d2a4a2f8cb4ef4604 (diff)
downloadhaskell-3ca7ecb57eefc43b4347e22ad2fd7a4962d84020.tar.gz
add casArray# primop, similar to casMutVar# but for array elements
Diffstat (limited to 'compiler/prelude')
-rw-r--r--compiler/prelude/primops.txt.pp8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp
index e275b23778..6e25d65488 100644
--- a/compiler/prelude/primops.txt.pp
+++ b/compiler/prelude/primops.txt.pp
@@ -794,6 +794,14 @@ primop ThawArrayOp "thawArray#" GenPrimOp
has_side_effects = True
code_size = { primOpCodeSizeForeignCall + 4 }
+primop CasArrayOp "casArray#" GenPrimOp
+ MutableArray# s a -> Int# -> a -> a -> State# s -> (# State# s, Int#, a #)
+ {Unsafe, machine-level atomic compare and swap on an element within an Array.}
+ with
+ out_of_line = True
+ has_side_effects = True
+
+
------------------------------------------------------------------------
section "Byte Arrays"
{Operations on {\tt ByteArray\#}. A {\tt ByteArray\#} is a just a region of