Browse thread
[Caml-list] Weak pointers and Gc.finalise
- Shivkumar Chandrasekaran
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| 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 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