Commit d9db81f4 authored by Joachim Breitner's avatar Joachim Breitner
Browse files

seqDmdType needs to seq the DmdEnv as well

otherwise this can retain large lazy calculations. This fixed one space
leak pointed out in #9675.
parent 23da971f
......@@ -1155,8 +1155,12 @@ ensureArgs n d | n == depth = d
-- See [Nature of result demand]
seqDmdType :: DmdType -> ()
seqDmdType (DmdType _env ds res) =
{- ??? env `seq` -} seqDemandList ds `seq` seqDmdResult res `seq` ()
seqDmdType (DmdType env ds res) =
seqDmdEnv env `seq` seqDemandList ds `seq` seqDmdResult res `seq` ()
seqDmdEnv :: DmdEnv -> ()
seqDmdEnv env = seqDemandList (varEnvElts env)
splitDmdTy :: DmdType -> (Demand, DmdType)
-- Split off one function argument
......
......@@ -496,12 +496,14 @@ test('T9020',
test('T9675',
[ only_ways(['optasm']),
compiler_stats_num_field('max_bytes_used',
[(wordsize(64), 29596552, 15),
[(wordsize(64), 26570896, 15),
# 2014-10-13 29596552
# 2014-10-13 26570896 seq the DmdEnv in seqDmdType as well
]),
compiler_stats_num_field('peak_megabytes_allocated',
[(wordsize(64), 66, 4),
[(wordsize(64), 58, 4),
# 2014-10-13 66
# 2014-10-13 58 seq the DmdEnv in seqDmdType as well
]),
compiler_stats_num_field('bytes allocated',
[(wordsize(64), 544489040, 10)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment