[project @ 2001-04-02 14:47:25 by simonmar]
authorsimonmar <unknown>
Mon, 2 Apr 2001 14:47:25 +0000 (14:47 +0000)
committersimonmar <unknown>
Mon, 2 Apr 2001 14:47:25 +0000 (14:47 +0000)
NOINLINE fixTc.  This fixes a space leak, believe it or not.  From the
comment:

-- aargh!  Not inlining fixTc alleviates a space leak problem.
-- Normally fixTc is used with a lazy tuple match: if the optimiser is
-- shown the definition of fixTc, it occasionally transforms the code
-- in such a way that the code generator doesn't spot the selector
-- thunks.  Sigh.

(BTW, NOINLINE pragmas quite often aren't honoured within a single
module, which looks like a bug).

ghc/compiler/typecheck/TcMonad.lhs

index b8adcc9..acbfd15 100644 (file)
@@ -217,6 +217,12 @@ mapBagTc f bag
 fixTc    :: (a -> TcM a)    -> TcM a
 fixNF_Tc :: (a -> NF_TcM a) -> NF_TcM a
 fixTc m env down = fixIO (\ loop -> m loop env down)
+{-# NOINLINE fixTc #-}
+-- aargh!  Not inlining fixTc alleviates a space leak problem.
+-- Normally fixTc is used with a lazy tuple match: if the optimiser is
+-- shown the definition of fixTc, it occasionally transforms the code
+-- in such a way that the code generator doesn't spot the selector
+-- thunks.  Sigh.
 
 recoverTc    :: TcM r -> TcM r -> TcM r
 recoverNF_Tc :: NF_TcM r -> TcM r -> NF_TcM r