From d772539b48c236024062cc9627703898be5b27d3 Mon Sep 17 00:00:00 2001 From: simonmar Date: Mon, 2 Apr 2001 14:47:25 +0000 Subject: [PATCH] [project @ 2001-04-02 14:47:25 by simonmar] 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ghc/compiler/typecheck/TcMonad.lhs b/ghc/compiler/typecheck/TcMonad.lhs index b8adcc9..acbfd15 100644 --- a/ghc/compiler/typecheck/TcMonad.lhs +++ b/ghc/compiler/typecheck/TcMonad.lhs @@ -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 -- 1.7.10.4