Finalizers and FFI
alastair at reid-consulting-uk.ltd.uk
Wed Jun 9 18:01:53 EDT 2004
> > import Foreign.ForeignPtr
> I couldn't get finalisers to work either with the newForeignPtr from
> this module. I didn't know how to create a proper FunPtr.
You create a FunPtr using foreign import:
foreign import ccall "malloc.h &free" free_ptr :: FunPtr (Ptr a -> IO ())
> In Foreign.Concurrent there is a newForeignPtr that is easier to use:
But, sadly, not portable.
More information about the Glasgow-haskell-users