Typo
[packages/base.git] / tests / weak001.hs
1 import Foreign
2 import System.Mem.Weak
3
4 kill:: Ptr a -> IO ()
5 kill a = do
6 w <- mkWeakPtr a Nothing
7 addFinalizer a $
8 deRefWeak w >> return ()
9
10 main:: IO ()
11 main = sequence_ . take 10000 . repeat $
12 mallocBytes 100 >>= kill >> return ()