diff options
author | Simon Marlow <marlowsd@gmail.com> | 2018-06-18 17:18:10 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2018-07-16 15:33:19 +0100 |
commit | 71f6b18ba365da9ee4795f6cbce6ec9f1bfe95e8 (patch) | |
tree | 5c827256559249740703e47359ab8bfe43173560 /ghc | |
parent | 8b6a9e5575fc848dc03b50b415aa57447654662f (diff) | |
download | haskell-71f6b18ba365da9ee4795f6cbce6ec9f1bfe95e8.tar.gz |
Fix space leaks
Summary:
All these were detected by -fghci-leak-check when GHC was
compiled *without* optimisation (e.g. using the "quick" build flavour).
Unfortunately I don't know of a good way to keep this working. I'd like
to just disable the -fghci-leak-check flag when the compiler is built
without optimisation, but it doesn't look like we have an easy way to do
that. And even if we could, it would be fragile anyway,
Test Plan: `cd testsuite/tests/ghci; make`
Reviewers: bgamari, hvr, erikd, tdammers
Subscribers: tdammers, rwbarton, thomie, carter
GHC Trac Issues: #15246
Differential Revision: https://phabricator.haskell.org/D4872
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/GHCi/UI.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index 15cfcf3362..bcb6d6e38c 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -1688,7 +1688,8 @@ loadModule' files = do -- Grab references to the currently loaded modules so that we can -- see if they leak. - leak_indicators <- if gopt Opt_GhciLeakCheck (hsc_dflags hsc_env) + let !dflags = hsc_dflags hsc_env + leak_indicators <- if gopt Opt_GhciLeakCheck dflags then liftIO $ getLeakIndicators hsc_env else return (panic "no leak indicators") @@ -1700,8 +1701,8 @@ loadModule' files = do GHC.setTargets targets success <- doLoadAndCollectInfo False LoadAllTargets - when (gopt Opt_GhciLeakCheck (hsc_dflags hsc_env)) $ - liftIO $ checkLeakIndicators (hsc_dflags hsc_env) leak_indicators + when (gopt Opt_GhciLeakCheck dflags) $ + liftIO $ checkLeakIndicators dflags leak_indicators return success -- | @:add@ command |