From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 4D5B3BB84 for ; Mon, 15 May 2006 14:32:19 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k4FCWIPF032375 for ; Mon, 15 May 2006 14:32:18 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA06166 for ; Mon, 15 May 2006 14:32:18 +0200 (MET DST) Received: from net.univ-savoie.fr (net.univ-savoie.fr [193.48.120.75]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k4FCWHLB030956 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 15 May 2006 14:32:18 +0200 Received: from post.bourget.univ-savoie.fr (post.bourget.univ-savoie.fr [193.48.120.73]) by net.univ-savoie.fr (8.12.3/jtpda-5.4) with ESMTP id k4FCWFX9008423 for ; Mon, 15 May 2006 14:32:15 +0200 Received: from [193.48.123.45] (d45.lama.univ-savoie.fr [193.48.123.45]) by post.bourget.univ-savoie.fr (8.12.3/jtpda-5.4) with ESMTP id k4FCWA1K012166 ; Mon, 15 May 2006 14:32:11 +0200 Message-ID: <446874CE.6010405@univ-savoie.fr> Date: Mon, 15 May 2006 14:32:14 +0200 From: Christophe Raffalli User-Agent: Mozilla Thunderbird 1.0.6-7.1.20060mdk (X11/20050322) X-Accept-Language: fr, en MIME-Version: 1.0 To: caml-list Subject: GC and map Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang) X-Miltered: at concorde with ID 446874D2.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 446874D1.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; christophe:01 raffalli:01 christophe:01 raffalli:01 univ-savoie:01 ocaml:01 bindings:01 integers:01 bindings:01 ocaml:01 struct:01 serialize:01 chablais:01 73376:01 univ-savoie:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Hello, I would like to implement the feature described bellow ... I think this is impossible in the current state of OCaml, but I may be wrong, so if someone can help ... 'a map is the type of a functional map from int to 'a (I do not care about the internal representation, except that performance would matter a little too) set is the type for set of int (here again representation do no matter that much) All maps can only appear in structure of type environment = { accessible_keys : set; map : 'a map } (this is possible to enforce with abstract type) Then I would like the GC to behave like this : Let m be of type 'a map and alive. Assume it appears only in the following alive environment { accessible_keys = a1; map = m } { accessible_keys = a2; map = m } ... { accessible_keys = an; map = m } Then, I would like the GC to remove all bindings in m for integers not present in a1 ... an. It would even be better if values associated to these bindings where not even scanned by the GC, but I think this is much more difficult. Any Idea (purely in OCaml or in C) ? This would be possible in C if in the "struct custom_operations" there was a "scan" function to scan values inside an allocated custom block. This function would be very similar to the serialize function ... Anyway I would prefer a pure OCaml solution. -- Christophe Raffalli Université de Savoie Batiment Le Chablais, bureau 21 73376 Le Bourget-du-Lac Cedex tél: (33) 4 79 75 81 03 fax: (33) 4 79 75 87 42 mail: Christophe.Raffalli@univ-savoie.fr www: http://www.lama.univ-savoie.fr/~RAFFALLI --------------------------------------------- IMPORTANT: this mail is signed using PGP/MIME At least Enigmail/Mozilla, mutt or evolution can check this signature. The public key is stored on www.keyserver.net ---------------------------------------------