summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZubin Duggal <zubin.duggal@gmail.com>2022-07-05 14:51:43 +0530
committerZubin Duggal <zubin.duggal@gmail.com>2022-07-26 16:28:48 +0530
commit7268f1b3e8cd4c1382834ee095bb775c523cebf8 (patch)
treef4cdef51a72d6151104310005012cd0289dc9bbb
parent42841ac39a0c85bf91e07f368725c4a2c6ac5dc3 (diff)
downloadhaskell-7268f1b3e8cd4c1382834ee095bb775c523cebf8.tar.gz
Fix potential space leak that arise from ModuleGraphs retaining references
to previous ModuleGraphs. This manifests in particular in `extendMG`. This patch is a backport of !8579 (cherry picked from commit 68e1e1842140c783542bcfdcd49cef538c6ab13d)
-rw-r--r--compiler/GHC/Unit/Module/Graph.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Unit/Module/Graph.hs b/compiler/GHC/Unit/Module/Graph.hs
index 5b5d152711..c4e29f83aa 100644
--- a/compiler/GHC/Unit/Module/Graph.hs
+++ b/compiler/GHC/Unit/Module/Graph.hs
@@ -72,9 +72,9 @@ instance Outputable ModuleGraphNode where
-- 'GHC.topSortModuleGraph' and 'GHC.Data.Graph.Directed.flattenSCC' to achieve this.
data ModuleGraph = ModuleGraph
{ mg_mss :: [ModuleGraphNode]
- , mg_non_boot :: ModuleEnv ModSummary
+ , mg_non_boot :: !(ModuleEnv ModSummary)
-- a map of all non-boot ModSummaries keyed by Modules
- , mg_boot :: ModuleSet
+ , mg_boot :: !ModuleSet
-- a set of boot Modules
, mg_needs_th_or_qq :: !Bool
-- does any of the modules in mg_mss require TemplateHaskell or