caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Weak pointers and Gc.finalise
@ 2004-04-01  4:48 Shivkumar Chandrasekaran
  2004-04-01 17:07 ` Damien Doligez
  0 siblings, 1 reply; 3+ messages in thread
From: Shivkumar Chandrasekaran @ 2004-04-01  4:48 UTC (permalink / raw)
  To: caml-list

I just noticed that if the only reference to a bigarray is in a Weak.t 
array, and if there is a finalisation function set on the bigarray, 
then that finalisation function is not necessarily called when the 
entry in the Weak.t array is set to None. Rather it is potentially 
called *much* later.

I am assuming that this is the right behaviour.

My question is, can I get the finalisation function to be called when 
the weak pointer is being set to None?

(Side note: I am trying to avoid Marshaling the Bigarray unless it is 
going to be garbage-collected. But if I cannot detect that, then I have 
to always Marshal it whenever its entries change, which is very 
inefficient.)

Thanks,

--shiv--

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-04-01 19:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-01  4:48 [Caml-list] Weak pointers and Gc.finalise Shivkumar Chandrasekaran
2004-04-01 17:07 ` Damien Doligez
2004-04-01 19:21   ` Shivkumar Chandrasekaran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).