summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2014-10-13 12:44:56 +0200
committerJoachim Breitner <mail@joachim-breitner.de>2014-10-13 15:20:12 +0200
commitd9db81f4ed8ca6e7262f84347174d6b0e2e9a76a (patch)
treec69e0d93614fe4684d2a6e44d7714886ab2987b4 /compiler
parent23da971fd6694a1fcb323f797a65c8cd976b7cc1 (diff)
downloadhaskell-d9db81f4ed8ca6e7262f84347174d6b0e2e9a76a.tar.gz
seqDmdType needs to seq the DmdEnv as well
otherwise this can retain large lazy calculations. This fixed one space leak pointed out in #9675.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/basicTypes/Demand.lhs8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/basicTypes/Demand.lhs b/compiler/basicTypes/Demand.lhs
index ed055b5808..2aa25ced53 100644
--- a/compiler/basicTypes/Demand.lhs
+++ b/compiler/basicTypes/Demand.lhs
@@ -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