From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA14162; Fri, 13 Aug 2004 15:43:25 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 PAA13700 for ; Fri, 13 Aug 2004 15:43:23 +0200 (MET DST) Received: from petasus.isw.intel.com (petasus.isw.intel.com [192.55.37.196]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i7DDhLmL017129 for ; Fri, 13 Aug 2004 15:43:22 +0200 Received: from swsmsxvs01.isw.intel.com (swsmsxvs01.isw.intel.com [172.28.130.22]) by petasus.isw.intel.com (8.12.9-20030918-01/8.12.9/d: small-solo.mc,v 1.9 2004/01/09 01:01:53 root Exp $) with SMTP id i7DDhDNf028327; Fri, 13 Aug 2004 13:43:22 GMT Received: from swsmsx331.ger.corp.intel.com ([172.28.130.50]) by swsmsxvs01.isw.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004081314431712150 ; Fri, 13 Aug 2004 14:43:17 +0100 Received: from swsmsx402.ger.corp.intel.com ([172.28.130.26]) by swsmsx331.ger.corp.intel.com with Microsoft SMTPSVC(5.0.2195.6713); Fri, 13 Aug 2004 14:43:16 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: AW: [Caml-list] The tag bit Date: Fri, 13 Aug 2004 14:43:15 +0100 Message-ID: <78B55F0E8771CC4B8F6995AB83AF6552051138E5@swsmsx402.ger.corp.intel.com> Thread-Topic: AW: [Caml-list] The tag bit Thread-Index: AcSBNg8c/9EYiywhTVm0APAlP94S3AABDzSQ From: "Ennals, Robert" To: "Christophe Raffalli" , X-OriginalArrivalTime: 13 Aug 2004 13:43:16.0297 (UTC) FILETIME=[7C608390:01C4813B] X-Miltered: at nez-perce with ID 411CC57A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 incompatible:01 buffer:01 pointers:01 pointers:01 tagging:01 owner-caml-:01 raffalli:01 2004:99 jacques:01 bauer:01 caml-list:01 hashtbl:01 caml's:01 raffalli:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Unfortunately, conservative GC is incompatible with copying collection = (which I believe is what O'Caml uses - though I may be wrong). With a copying collector, data is allocated sequentially in a nursery = buffer, and the collector periodically moves the reachable data to a new = area area of memory, fixing up all pointers to point to new locations. The advantage of this approach is that allocation on the heap is very = cheap - just return the current position of the heap pointer, and = increment it by the object size. The downside is that one must know for certain whether or not an object = is a pointer - as pointers will be changed when the data they point to = is moved. Regarding the block-based approach: as others have mentioned - this = approach is entirely practical, and is indeed the approach taken by = several other compiler implementations (including GHC), however = anecdotal evidence suggests that the bit tagging approach makes GC = faster. > -----Original Message----- > From: owner-caml-list@pauillac.inria.fr [mailto:owner-caml- > list@pauillac.inria.fr] On Behalf Of Christophe Raffalli > Sent: 13 August 2004 13:59 > To: Jacques Garrigue > Cc: Christoph.Bauer@lms-gmbh.de; caml-list@inria.fr > Subject: Re: AW: [Caml-list] The tag bit >=20 > There is a less costly way to avoid the tag bit in integer: > "conservative GC": any int which happens to point in an alloccated = block > (or only at the beginning if you do not consider C but ML) is = considered > as a pointer. You will have very few wrong pointers (especially in the > second case). Moreover, array of int or float, or block of memory can = be > tagged with a flag saying they do not old pointer. >=20 > The Boehm GC for C and C++ is very succefull to do that and very often > allow you to share data-structure in C as you would in ML (not caring > about who will release first the data) and gain both speed and memory. >=20 > Does anyone have a comparison between two identical GC except one > should have a tag bit and the other be conservative ? >=20 > The cost of conservative GC is the test to know if an int is pointing = in > (or at the beginning) of an allocated block which require for instance = a > hashtbl of allocated blocks by adress ranges. I don't know if the gain > for arithmetic + easier C interface would compensate the lost in the = GC > for a real GC like Caml's. >=20 >=20 > -- > Christophe Raffalli > Universit=E9 de Savoie > Batiment Le Chablais, bureau 21 > 73376 Le Bourget-du-Lac Cedex >=20 > t=E9l: (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 > --------------------------------------------- >=20 > ------------------- > To unsubscribe, mail caml-list-request@inria.fr Archives: > http://caml.inria.fr > Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: > http://caml.inria.fr/FAQ/ > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners