summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-11-22 11:10:51 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2022-11-22 11:12:15 +0000
commit4d66cf029fa7d1398974111d0bc574fa2415afb6 (patch)
tree46b4b740ad2770507029bfd6895ad6c7904a684a
parent02d3511b8d248ea9429512830f8f17b31688a6a6 (diff)
downloadhaskell-wip/hpt-space-leak.tar.gz
notes: Fix references to HPT space leak notewip/hpt-space-leak
Updating this note was missed when updating the HPT to the HUG. Fixes #22477
-rw-r--r--compiler/GHC/Iface/Load.hs14
1 files changed, 9 insertions, 5 deletions
diff --git a/compiler/GHC/Iface/Load.hs b/compiler/GHC/Iface/Load.hs
index b169db60f5..9bf2aaccc8 100644
--- a/compiler/GHC/Iface/Load.hs
+++ b/compiler/GHC/Iface/Load.hs
@@ -602,8 +602,11 @@ This really happens in practice. The module "GHC.Hs.Expr" gets
This is a mess.
-Note [HPT space leak] (#15111)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Note [Home Unit Graph space leak]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Ticket: #15111
+
In IfL, we defer some work until it is demanded using forkM, such
as building TyThings from IfaceDecls. These thunks are stored in
the ExternalPackageState, and they might never be poked. If we're
@@ -614,14 +617,15 @@ for ever.
Therefore, when loading a package interface file , we use a "clean"
version of the HscEnv with all the data about the currently loaded
program stripped out. Most of the fields can be panics because
-we'll never read them, but hsc_HPT needs to be empty because this
+we'll never read them, but hsc_HUG needs to be empty because this
interface will cause other interfaces to be loaded recursively, and
-when looking up those interfaces we use the HPT in loadInterface.
+when looking up those interfaces we use the HUG in loadInterface.
We know that none of the interfaces below here can refer to
-home-package modules however, so it's safe for the HPT to be empty.
+home-package modules however, so it's safe for the HUG to be empty.
-}
-- Note [GHC Heap Invariants]
+-- Note [Home Unit Graph space leak]
dontLeakTheHUG :: IfL a -> IfL a
dontLeakTheHUG thing_inside = do
env <- getTopEnv