From 9a422839cc8bf6090fa35042ddd18e9372d854c0 Mon Sep 17 00:00:00 2001 From: hallgren Date: Fri, 7 Feb 2014 13:57:13 +0000 Subject: pgf-shell: enable -rtsopts, call performGC between commands This is to make it easier to find the cause of space leaks. --- src/runtime/haskell-bind/examples/pgf-shell.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/runtime/haskell-bind/examples') diff --git a/src/runtime/haskell-bind/examples/pgf-shell.hs b/src/runtime/haskell-bind/examples/pgf-shell.hs index 04b6522da..224c16512 100644 --- a/src/runtime/haskell-bind/examples/pgf-shell.hs +++ b/src/runtime/haskell-bind/examples/pgf-shell.hs @@ -14,6 +14,7 @@ import System.IO.Error(catchIOError) import System.Environment import CRuntimeFFI import CId +import System.Mem(performGC) main = getPGF =<< getArgs @@ -21,7 +22,8 @@ getPGF [path] = pgfShell =<< readPGF path getPGF _ = putStrLn "Usage: pgf-shell " pgfShell pgf = - forever $ do putStr "> "; hFlush stdout + forever $ do performGC + putStr "> "; hFlush stdout execute pgf =<< readLn execute pgf cmd = -- cgit v1.2.3