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
Re: [Caml-list] Weak hash table
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Damien Doligez <damien.doligez@i...>
Subject: Re: [Caml-list] Weak hash table
>From: Christophe Raffalli <>
>The semantics of weak pointer are just some kind of cache where value
>can be erased at any time by the GC.

This is what the documentation specifies.

>The kind of weak array you need is array where value are erased by the
>GC if and only if the value is not pointed from outside the weak array.
>That is the mark phase of the GC does not traverse weak array.

This is what the implementation does (if you replace "if and only if"
with "at some time when" in the above).

The weak arrays are grossly underspecified because I don't know how to
clearly explain what they do to someone who doesn't already know what
a weak pointer is.  If someone wants to do write that explanation,
I'll be very happy.

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