diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2020-11-10 16:37:21 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2020-11-10 16:37:21 +0000 |
commit | b6287f38d50ed46aa337158943ef855bf9000df2 (patch) | |
tree | 3791a262bae9dbdb1f93753e3acf8128ac1bf1e4 /ST.hs | |
parent | a4b44644bbbc639ca214aa3b13ec72d93ae51e49 (diff) | |
download | haskell-wip/ghc-debug-stack.tar.gz |
WIP: ST example working (small bitmap stack frames)wip/ghc-debug-stack
Diffstat (limited to 'ST.hs')
-rw-r--r-- | ST.hs | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -0,0 +1,20 @@ +module Main where + +import GHC.Exts.Heap +import System.Mem + +main = foo 100 + +loop 0 = foo 0 +loop n = print ("ITERATION", n) >> foo n >> loop (n-1) + +{-# NOINLINE foo #-} +foo 0 = () <$ getStack +foo n = print "x" >> foo (n - 1) >> print "x" + +getStack = do + fs <- getCurrentStackData + print fs + getLine + print (length fs) + getLine |