summaryrefslogtreecommitdiff
path: root/compiler/GHC/Unit
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-10-08 09:59:02 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-10-12 19:17:15 -0400
commit0d7117916541d6bb0041200e128ce4088086a973 (patch)
tree6dcda6104b966e0a89ccf82196c26d2b965718e3 /compiler/GHC/Unit
parent053d9deb3c107db0d292a6a8dc4ba8cf2d432743 (diff)
downloadhaskell-0d7117916541d6bb0041200e128ce4088086a973.tar.gz
More strictness around HomePackageTable
This patch makes some operations to do with HomePackageTable stricter * Adding a new entry into the HPT would not allow the old HomeModInfo to be collected because the function used by insertWith wouldn't be forced. * We're careful to force the new MVar value before it's inserted into the global MVar as otherwise we retain references to old entries.
Diffstat (limited to 'compiler/GHC/Unit')
-rw-r--r--compiler/GHC/Unit/Home/ModInfo.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/GHC/Unit/Home/ModInfo.hs b/compiler/GHC/Unit/Home/ModInfo.hs
index d41bc0c9f6..b5960a5223 100644
--- a/compiler/GHC/Unit/Home/ModInfo.hs
+++ b/compiler/GHC/Unit/Home/ModInfo.hs
@@ -41,10 +41,12 @@ data HomeModInfo = HomeModInfo
-- ^ The basic loaded interface file: every loaded module has one of
-- these, even if it is imported from another package
- , hm_details :: !ModDetails
+ , hm_details :: ModDetails
-- ^ Extra information that has been created from the 'ModIface' for
-- the module, typically during typechecking
+ -- This field is LAZY because a ModDetails is constructed by knot tying.
+
, hm_linkable :: !(Maybe Linkable)
-- ^ The actual artifact we would like to link to access things in
-- this module.