summaryrefslogtreecommitdiff
path: root/compiler/utils/FastString.hs
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2015-01-27 16:20:54 -0800
committerEdward Z. Yang <ezyang@cs.stanford.edu>2015-01-28 13:54:58 -0800
commit07ee96faac4996cde0ab82789eec0b70d1a35af0 (patch)
tree1a36efc948d7634a95734d0c527286a5070f4c76 /compiler/utils/FastString.hs
parent276da7929c187f007c198a38e88bdad91866e500 (diff)
downloadhaskell-07ee96faac4996cde0ab82789eec0b70d1a35af0.tar.gz
Use strict atomicModifyIORef' (added in GHC 7.6).
Summary: Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: austin, hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D635
Diffstat (limited to 'compiler/utils/FastString.hs')
-rw-r--r--compiler/utils/FastString.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/utils/FastString.hs b/compiler/utils/FastString.hs
index 9607d24823..40c3882b87 100644
--- a/compiler/utils/FastString.hs
+++ b/compiler/utils/FastString.hs
@@ -109,7 +109,7 @@ import ExtsCompat46
import System.IO
import System.IO.Unsafe ( unsafePerformIO )
import Data.Data
-import Data.IORef ( IORef, newIORef, readIORef, atomicModifyIORef )
+import Data.IORef ( IORef, newIORef, readIORef, atomicModifyIORef' )
import Data.Maybe ( isJust )
import Data.Char
import Data.List ( elemIndex )
@@ -340,7 +340,7 @@ mkFastStringWith mk_fs !ptr !len = do
n <- get_uid
new_fs <- mk_fs n
- atomicModifyIORef bucket $ \ls2 ->
+ atomicModifyIORef' bucket $ \ls2 ->
-- Note [Double-checking the bucket]
let delta_ls = case ls1 of
[] -> ls2
@@ -357,7 +357,7 @@ mkFastStringWith mk_fs !ptr !len = do
where
!(FastStringTable uid _arr) = string_table
- get_uid = atomicModifyIORef uid $ \n -> (n+1,n)
+ get_uid = atomicModifyIORef' uid $ \n -> (n+1,n)
mkFastStringBytes :: Ptr Word8 -> Int -> FastString
mkFastStringBytes !ptr !len =
@@ -502,7 +502,7 @@ zEncodeFS fs@(FastString _ _ _ ref) =
case m of
Just zfs -> return zfs
Nothing -> do
- atomicModifyIORef ref $ \m' -> case m' of
+ atomicModifyIORef' ref $ \m' -> case m' of
Nothing -> let zfs = mkZFastString (zEncodeString (unpackFS fs))
in (Just zfs, zfs)
Just zfs -> (m', zfs)