Version française
Home     About     Download     Resources     Contact us    
Browse thread
Weak pointers
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Daniel de Rauglaudre <ddr@p...>
Subject: Re: Weak pointers
> The problem here is that you use constant string data: these citations
> are global references that are never garbage collected, since there
> really exists a pointer to them from the global symbol table.
> 
> Use strings allocated by make_string (== String.create) instead: you
> should observe what you expected to observe.

I found another trick to make my example work: replace
   let r = ref "hello"
by:
   let r = ref ("hello" ^ "")

:-)


--------------------------------------------------------------------------
 Daniel de RAUGLAUDRE

 Projet Cristal - INRIA Rocquencourt
 Tel: +33 (01) 39 63 53 51
 Email: daniel.de_rauglaudre@inria.fr
 Web: http://pauillac.inria.fr/~ddr/
--------------------------------------------------------------------------