RE: Why I want Haskell finalizers

2002-10-17 Thread Simon Marlow
No, that's only a partial (and indeed very incomplete) solution. It relies on the Java GC knowing that that particular reference to the Haskell StablePtr is the only one that matters, and vice-versa for the Haskell GC. So you want StablePtrs to contain a reference count, a new

Why I want Haskell finalizers

2002-10-16 Thread George Russell
The document which Simon and Alastair have kindly put together asks for more details about why I want foreign garbage collectors to be able to call back to Haskell. Well I can't supply many details, because this is not immediately required by the UniForM/MMiSS project we are working on at

Re: Why I want Haskell finalizers

2002-10-16 Thread Alastair Reid
George writes: If you have Haskell talking to some other language with a garbage collector, be it Java or SML, then at a given point of the program you can in general expect to have Haskell holding stable pointers to objects referenced from their world by the other language, and vice-versa.

Re: Why I want Haskell finalizers

2002-10-16 Thread George Russell
Alastair Reid wrote: George writes: If you have Haskell talking to some other language with a garbage collector, be it Java or SML, then at a given point of the program you can in general expect to have Haskell holding stable pointers to objects referenced from their world by the

Re: Why I want Haskell finalizers

2002-10-16 Thread Alastair Reid
So what you want is for the Java GC to call hs_freeStablePtr on all the Haskell objects that just died? No, that's only a partial (and indeed very incomplete) solution. It relies on the Java GC knowing that that particular reference to the Haskell StablePtr is the only one that matters,