projects
/
ghc-hetmet.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[project @ 2000-02-25 15:20:33 by simonmar]
[ghc-hetmet.git]
/
ghc
/
tests
/
lib
/
should_run
/
weak001.hs
1
import Addr
2
import Weak
3
4
kill:: Addr -> 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
malloc 100 >>= kill >> return ()
13
14
foreign import malloc :: Int -> IO Addr