summaryrefslogtreecommitdiff
path: root/compiler/GHC/Unit
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-10-15 09:49:00 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-10-19 03:31:27 -0400
commit877e6685e3d802f159b1d9db785bc663a37c31cb (patch)
treec70e8f1f2b06fdef486a612b7f458625cdfeb4ff /compiler/GHC/Unit
parentfdfb3b03baaa81a532a7e4554e13ccd4d342461e (diff)
downloadhaskell-877e6685e3d802f159b1d9db785bc663a37c31cb.tar.gz
Temporary fix for leak with -fno-code (#20509)
This hack inserted for backpack caused a very bad leak when using -fno-code where EPS entries would end up retaining stale HomePackageTables. For any interactive user, such as HLS, this is really bad as once the entry makes it's way into the EPS then it's there for the rest of the session. This is a temporary fix which "solves" the issue by filtering the HPT to only the part which is needed for the hack to work, but in future we want to separate out hole modules from the HPT entirely to avoid needing to do this kind of special casing. ------------------------- Metric Decrease: MultiLayerModulesDefsGhci -------------------------
Diffstat (limited to 'compiler/GHC/Unit')
-rw-r--r--compiler/GHC/Unit/Home/ModInfo.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/GHC/Unit/Home/ModInfo.hs b/compiler/GHC/Unit/Home/ModInfo.hs
index b5960a5223..2173b7431b 100644
--- a/compiler/GHC/Unit/Home/ModInfo.hs
+++ b/compiler/GHC/Unit/Home/ModInfo.hs
@@ -7,6 +7,7 @@ module GHC.Unit.Home.ModInfo
, eltsHpt
, filterHpt
, allHpt
+ , anyHpt
, mapHpt
, delFromHpt
, addToHpt
@@ -90,6 +91,9 @@ filterHpt = filterUDFM
allHpt :: (HomeModInfo -> Bool) -> HomePackageTable -> Bool
allHpt = allUDFM
+anyHpt :: (HomeModInfo -> Bool) -> HomePackageTable -> Bool
+anyHpt = anyUDFM
+
mapHpt :: (HomeModInfo -> HomeModInfo) -> HomePackageTable -> HomePackageTable
mapHpt = mapUDFM