summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-10-11 17:04:13 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2021-10-11 22:50:42 +0100
commit1d9195b9c3005ac4ec25ea8692c09b8563951bbe (patch)
treed414b04e67efc1b5e32ec17d448b19bb7ccc1ab4
parente5fefb4e1448d77ce393ea85991e0aa41f17225b (diff)
downloadhaskell-wip/ghci-space.tar.gz
Force name_exe field to avoid retaining entire UnitEnv (including whole HPT)wip/ghci-space
Not forcing this one place will result in GHCi using 2x memory on a reload.
-rw-r--r--compiler/GHC/Driver/Make.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Driver/Make.hs b/compiler/GHC/Driver/Make.hs
index 24ad1a581a..9ed6c24804 100644
--- a/compiler/GHC/Driver/Make.hs
+++ b/compiler/GHC/Driver/Make.hs
@@ -697,11 +697,11 @@ guessOutputFile = modifySession $ \env ->
ml_hs_file (ms_location ms)
name = fmap dropExtension mainModuleSrcPath
- name_exe = do
+ !name_exe = do
-- we must add the .exe extension unconditionally here, otherwise
-- when name has an extension of its own, the .exe extension will
-- not be added by GHC.Driver.Pipeline.exeFileName. See #2248
- name' <- if platformOS platform == OSMinGW32
+ !name' <- if platformOS platform == OSMinGW32
then fmap (<.> "exe") name
else name
mainModuleSrcPath' <- mainModuleSrcPath