From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA28566 for caml-red; Tue, 23 Jan 2001 22:57:19 +0100 (MET) 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 JAA21462 for ; Tue, 23 Jan 2001 09:29:52 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f0N8TgD21944; Tue, 23 Jan 2001 09:29:42 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA31664; Tue, 23 Jan 2001 09:29:41 +0100 (MET) Date: Tue, 23 Jan 2001 09:29:41 +0100 From: Xavier Leroy To: Vitaly Lugovsky Cc: caml-list@inria.fr Subject: Re: GC question Message-ID: <20010123092941.A12784@pauillac.inria.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: ; from vsl@ontil.ihep.su on Sat, Jan 13, 2001 at 05:16:08AM +0300 Sender: weis@pauillac.inria.fr > What shall I do, if I want to store a pointer to a caml value > in a structure outside the caml heap? Is there any GC hints for it? You need to tell the GC the address (outside the heap) where the Caml value is stored, using register_global_root(). When the external data structure is no longer relevant, or is about to be freed, call remove_global_root() to tell the GC that the global root is no longer there, thus allowing the GC to reclaim the corresponding Caml data structure. - Xavier Leroy