Browse thread
Weak pointers
- Emmanuel Engel
[
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: | 1997-03-20 (14:36) |
From: | Emmanuel Engel <Emmanuel.Engel@l...> |
Subject: | Weak pointers |
I wonder when Weaks pointers are erased by the GC. As soon as it can be or when there is no more memory ? In the second case, does all the weaks pointers that can be erased are erased or just enough to allocate new memory. In this case, which are erased, the older or the younger ? Is it a good idea to use weak pointers to implement more or less a cache ? Something like type ('a,'b) cache = (* In fact a binary tree *) Node of 'a * 'b * ('a,'b)cache Weak.t |Leaf and to use the usual fonctions over binary tree. -- - Emmanuel Engel