blob: 28881dc0164271f6ce3f3a39ad7583382f0515cc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
module Main (main) where
import GHC.Conc
import Control.Concurrent
import Control.Exception
main = do
setAllocationCounter (10*1024)
enableAllocationLimit
-- alloc limit overflow while masked: should successfully print the
-- result, and then immediately raise the exception
r <- mask_ $ try $ print (length [1..100000])
print (r :: Either SomeException ())
|