[Haskell-cafe] Re: FPS: Finalizers not running (was Memory usage outside of the Haskell heap)

Joel Reymont joelr1 at gmail.com
Sun Nov 6 09:44:21 EST 2005

The finalizers do run if I insert unsafeFinalize fps right before  
recursing into foo, like this:

main = do foo data_

foo [] = return ()
foo (x:xs) =
     do let fps = P.packWords x
        installFinalizer fps
        putStrLn $ "fps: " ++ show fps
        unsafeFinalize fps
        foo xs

installFinalizer fps@(P.PS fp _ _) =
     addForeignPtrConcFinalizer fp $
        putStrLn $ "--- Finalized: " ++ show (P.unpackWords fps)

	Thanks, Joel

On Nov 6, 2005, at 2:29 PM, Joel Reymont wrote:

> David,
> I followed your suggestion and I think the finalizers for FPS are  
> not running.
> Please take a look at http://wagerlabs.com/Bar.hs to see what I  
> mean. I had to modify the FPS export list to expose the constructor  
> but that's the only change I made.


More information about the Haskell-Cafe mailing list