From 877e6685e3d802f159b1d9db785bc663a37c31cb Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Fri, 15 Oct 2021 09:49:00 +0100 Subject: 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 ------------------------- --- compiler/GHC/Unit/Home/ModInfo.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/GHC/Unit') 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 -- cgit v1.2.1