English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Objective Caml 1.04 released
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1997-03-17 (18:02)
From: Frank Christoph <christo@n...>
Subject: Re: Weak pointers
(I wrote:)

>>>>> "Xavier" == Xavier Leroy <Xavier.Leroy@inria.fr> writes:
>> Release 1.04 of Objective Caml is now available.  The main novelty in this
>> release is the port of the Caml Light replay debugger. Also, the
>> native-code compiler now works on Silicon Graphics, weak pointers are
>> supported, and the foreign interface was enriched to make calling Caml from
>> C easier.

>   What is a "weak pointer"?  Is it described in the manual?

  My apologies.  I just discovered module Weak in the standard library.
However, I still don't understand the concept.  The manual says:

  "A weak pointer is an object that the garbage collector may erase at any
time.  A weak pointer is said to be full if it points to an object, empty if
the object was erased by the GC."

  Does this mean that even a full weak pointer can be erased?  What does "at
any time" mean --- even if the pointer is still accessible from the root set,
its contents can be erased?  Is this intended to contrast with a usual
reference, which must always be initialized?  Are weak pointers intended to
model C pointers?

  Could someone post an example of their use?

Frank Christoph                 Next Solution Co.      Tel: 0424-98-1811
christo@nextsolution.co.jp                             Fax: 0424-98-1500