diff options
author | Simon Marlow <marlowsd@gmail.com> | 2015-05-08 15:28:40 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2015-05-11 12:46:17 +0100 |
commit | cf7573b8207bbb17c58612f3345e0b17d74cfb58 (patch) | |
tree | 93321c1def706be49644ac30c05bc5251b041d62 /testsuite/tests/ghc-api/T8628.hs | |
parent | 2666ba369f8d3e7d187876b7b602d42f2d6db381 (diff) | |
download | haskell-cf7573b8207bbb17c58612f3345e0b17d74cfb58.tar.gz |
More accurate allocation stats for :set +s
The point of this commit is to make the memory allocation statistic
from :set +s in GHCi a lot more accurate. Currently it uses the total
allocation figure calculated by the RTS, which is only updated during
GC, so can be wrong by an arbitrary amount. The fix is to the the
per-thread allocation counter that was introduced for allocation
limits.
This required changes to the GHC API, because we now have to return
the allocation value from each evaluation. Rather than just change
the API, I introduced a new API and deprecated the old one. The new
one is simpler and more extensible, so hopefully we won't need to make
this transition in the future. See GHC.hs for details.
Diffstat (limited to 'testsuite/tests/ghc-api/T8628.hs')
-rw-r--r-- | testsuite/tests/ghc-api/T8628.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/testsuite/tests/ghc-api/T8628.hs b/testsuite/tests/ghc-api/T8628.hs index 203d3282ab..d3b05a9f86 100644 --- a/testsuite/tests/ghc-api/T8628.hs +++ b/testsuite/tests/ghc-api/T8628.hs @@ -24,10 +24,10 @@ main setContext [ IIDecl (simpleImportDecl pRELUDE_NAME) , IIDecl (simpleImportDecl (mkModuleNameFS (fsLit "System.IO")))] runDecls "data X = Y ()" - runStmt "print True" RunToCompletion - gtry $ runStmt "print (Y ())" RunToCompletion :: GhcMonad m => m (Either SomeException RunResult) + execStmt "print True" execOptions + gtry $ execStmt "print (Y ())" execOptions :: GhcMonad m => m (Either SomeException ExecResult) runDecls "data X = Y () deriving Show" _ <- dynCompileExpr "'x'" - runStmt "print (Y ())" RunToCompletion - runStmt "System.IO.hFlush System.IO.stdout" RunToCompletion + execStmt "print (Y ())" execOptions + execStmt "System.IO.hFlush System.IO.stdout" execOptions print "done" |