summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-02-08 16:03:46 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-03-26 19:00:07 -0400
commit532c6a541570e79891b3b68749cae9fcec42a939 (patch)
treeed0acea865c3e1bb72ee4f4d7e651f7d62184e4f /testsuite
parent599efd90d54a01802b1285c0e357738e4d0bdb3a (diff)
downloadhaskell-532c6a541570e79891b3b68749cae9fcec42a939.tar.gz
Remove UniqSupply from NameCache
As suggested by @alexbiehl, this patch replaces the always updated UniqSupply in NameCache with a fixed Char and use it with `uniqFromMask` to generate uniques. This required some refactoring because getting a new unique from the NameCache can't be done in pure code anymore, in particular not in an atomic update function for `atomicModifyIORef`. So we use an MVar instead to store the OrigNameCache field. For some reason, T12545 increases (+1%) on i386 while it decreases on other CI runners. T9630 ghc/peak increases only with the dwarf build on CI (+16%). Metric Decrease: T12425 T12545 T9198 T12234 Metric Increase: T12545 T9630 Update haddock submodule
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/hiefile/should_run/HieQueries.hs4
-rw-r--r--testsuite/tests/hiefile/should_run/PatTypes.hs4
2 files changed, 2 insertions, 6 deletions
diff --git a/testsuite/tests/hiefile/should_run/HieQueries.hs b/testsuite/tests/hiefile/should_run/HieQueries.hs
index 68f6516d0e..d48dd02cd0 100644
--- a/testsuite/tests/hiefile/should_run/HieQueries.hs
+++ b/testsuite/tests/hiefile/should_run/HieQueries.hs
@@ -42,9 +42,7 @@ point' = (37,9)
data A = A deriving Show
makeNc :: IO NameCache
-makeNc = do
- uniq_supply <- mkSplitUniqSupply 'z'
- initNameCache uniq_supply []
+makeNc = initNameCache 'z' []
dynFlagsForPrinting :: String -> IO DynFlags
dynFlagsForPrinting libdir = do
diff --git a/testsuite/tests/hiefile/should_run/PatTypes.hs b/testsuite/tests/hiefile/should_run/PatTypes.hs
index 0f5f733066..67a89d1c49 100644
--- a/testsuite/tests/hiefile/should_run/PatTypes.hs
+++ b/testsuite/tests/hiefile/should_run/PatTypes.hs
@@ -33,9 +33,7 @@ p3 = (24,11)
p4 = (26,5)
makeNc :: IO NameCache
-makeNc = do
- uniq_supply <- mkSplitUniqSupply 'z'
- initNameCache uniq_supply []
+makeNc = initNameCache 'z' []
dynFlagsForPrinting :: String -> IO DynFlags
dynFlagsForPrinting libdir = do