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
Hweak question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-09-04 (14:14)
From: Alessandro Baretta <a.baretta@s...>
Subject: Hweak question
While googling for weak pointer resources, I have discovered the beautiful Hweak 
library, implementing a real weak hashtable. I should have googled for it a long 
time ago.

Just one question: how do you manage to maintain the bound value live when the 
key is live? As far as I know from experimenting with the weak hashtables in the 
vanilla distribution it is enough for the pointer to the bound value to become 
unreachable for it be garbage collected away.

I tried implementating weak hastables on top of the weak "hashed set" functor of 
the standard library but never managed to get the GC to keep my bindings live so 
long as the the key was live.



Ing. Alessandro Baretta

Studio Baretta

Consulenza Tecnologica e Ingegneria Industriale
Technological Consulting and Industrial Engineering

tel. +39 02 370 111 55
fax. +39 02 370 111 54

tel. +39 02 9880 271
fax. +39 02 9828 0296