From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA08563 for caml-redistribution; Tue, 1 Apr 1997 14:43:01 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA07981 for ; Tue, 1 Apr 1997 14:03:11 +0200 (MET DST) Received: from peray.inria.fr (peray.inria.fr [128.93.8.98]) by concorde.inria.fr (8.7.6/8.7.3) with SMTP id OAA13901; Tue, 1 Apr 1997 14:03:10 +0200 (MET DST) Received: by peray.inria.fr; Tue, 1 Apr 1997 14:03:09 +0200 From: Daniel de Rauglaudre Message-Id: <199704011203.AA07910@peray.inria.fr> Subject: Re: Weak pointers In-Reply-To: <199704011057.MAA06827@pauillac.inria.fr> from Pierre Weis at "Apr 1, 97 12:57:27 pm" To: Pierre.Weis@inria.fr (Pierre Weis) Date: Tue, 1 Apr 1997 14:03:08 +0200 (MET DST) Cc: caml-list@inria.fr Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: weis > 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/ --------------------------------------------------------------------------