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-05 15:07:22 +0530
commit68e1e1842140c783542bcfdcd49cef538c6ab13d (patch)
tree2bbd95ec5d637222b597f073a22cf0ecff093b03
parentcef1f2e797f004d3083758784249794abf591385 (diff)
downloadhaskell-wip/9.2-extendMG-leak.tar.gz
Fix potential space leak that arise from ModuleGraphs retaining referenceswip/9.2-extendMG-leak
to previous ModuleGraphs. This manifests in particular in `extendMG`. This patch is a backport of !8579
-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