Commit c73d8f07 authored by Simon Marlow's avatar Simon Marlow
Browse files

avoid running out of stack

parent acc4ba42
...@@ -5,6 +5,7 @@ import Foreign.ForeignPtr ...@@ -5,6 +5,7 @@ import Foreign.ForeignPtr
import Foreign import Foreign
import GHC.TopHandler import GHC.TopHandler
import Control.Concurrent import Control.Concurrent
import Data.List
foreign export ccall fin :: Ptr Int -> Ptr Int -> IO () foreign export ccall fin :: Ptr Int -> Ptr Int -> IO ()
foreign import ccall "&fin" finptr :: FinalizerEnvPtr Int Int foreign import ccall "&fin" finptr :: FinalizerEnvPtr Int Int
...@@ -20,4 +21,4 @@ main = do ...@@ -20,4 +21,4 @@ main = do
a <- new (55 :: Int) a <- new (55 :: Int)
env <- new (66 :: Int) env <- new (66 :: Int)
fp <- newForeignPtrEnv finptr env a fp <- newForeignPtrEnv finptr env a
sum [1..1000000] `seq` return () foldl' (+) 0 [1..500000] `seq` return ()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment