<commit_before>import Addr
import Weak

kill:: Addr -> IO ()
kill a = do
    w <- mkWeakPtr a Nothing
    addFinalizer a $
        deRefWeak w >> return ()

main:: IO ()
main = sequence_ . take 10000 . repeat $
    malloc 100 >>= kill >> return ()

foreign import malloc :: Int -> IO Addr<commit_msg>[project @ 2002-06-18 13:18:34 by simonmar] update to not use the lang package<commit_after>import Foreign
import System.Mem.Weak

kill:: Ptr a -> IO ()
kill a = do
    w <- mkWeakPtr a Nothing
    addFinalizer a $
        deRefWeak w >> return ()

main:: IO ()
main = sequence_ . take 10000 . repeat $
    mallocBytes 100 >>= kill >> return ()
{'fraction_non_alphanumeric': 0.11956521739130435, 'fraction_numerical': 0.046583850931677016, 'mean_word_length': 2.8392857142857144, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3134740', 'n_tokens_mistral': 239, 'n_tokens_neox': 199, 'n_words': 77}