Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Weak pointers and Gc.finalise
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-04-01 (04:48)
From: Shivkumar Chandrasekaran <shiv@e...>
Subject: [Caml-list] Weak pointers and Gc.finalise
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 



To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: