From 8cf861ba91941412e93f70a916233223aebf686e Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Sun, 16 Mar 2008 21:17:48 +0000 Subject: [PATCH] Fix a space leak in :trace (trac #2128) We were doing lots of cons'ing and tail'ing without forcing the tails, so were building up lots of thunks. --- compiler/main/InteractiveEval.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index 7014d28..40eb66a 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -360,7 +360,7 @@ rethrow dflags io = Exception.catch io $ \e -> do -- NB. not catchDyn withInterruptsSentTo :: ThreadId -> IO r -> IO r withInterruptsSentTo thread get_result = do bracket (modifyMVar_ interruptTargetThread (return . (thread:))) - (\_ -> modifyMVar_ interruptTargetThread (return.tail)) + (\_ -> modifyMVar_ interruptTargetThread (\tl -> return $! tail tl)) (\_ -> get_result) -- This function sets up the interpreter for catching breakpoints, and -- 1.7.10.4