Ashley Yakeley [EMAIL PROTECTED] wrote:
In article [EMAIL PROTECTED],
Fergus Henderson [EMAIL PROTECTED] wrote:
Should there perhaps be something like ...
newForeignPtrWithUserData :: Ptr a - Ptr b - FunPtr (Ptr a - Ptr b - IO ()) -
IO (ForeignPtr a)
... where the second argument is a userData
How do I pass a parameter to a finaliser? The pointer itself does not
have enough information to run the finaliser, I need an extra parameter
available at the time the pointer is created.
This was easy to do when I could write finalisers in Haskell, of course,
since I could just apply the
[...] doesn't answer the question of why these things have changed [...]
We dropped Haskell finalizers because neither Hugs nor NHC could implement
them and implementing them would pretty much require them to implement
preemptive concurrency (i.e., multiple threads each with their own stacks).
Daan Leijen [EMAIL PROTECTED] wrote:
(allthough it doesn't answer the question of [...] how to add parameters to the new newForeignPtr function,)
Should there perhaps be something like ...
newForeignPtrWithUserData :: Ptr a - Ptr b - FunPtr (Ptr a - Ptr b - IO ()) - IO (ForeignPtr a)
... where