From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id C2493BBC4 for ; Tue, 14 Apr 2009 07:25:37 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq0DANm640nZSMDji2dsb2JhbACBUpRhAQEBCgsKBw8FtkODfAY X-IronPort-AV: E=Sophos;i="4.38,431,1233529200"; d="scan'208";a="27624571" Received: from fmmailgate02.web.de ([217.72.192.227]) by mail1-smtp-roc.national.inria.fr with ESMTP; 14 Apr 2009 07:25:36 +0200 Received: from smtp08.web.de (fmsmtp08.dlan.cinetic.de [172.20.5.216]) by fmmailgate02.web.de (Postfix) with ESMTP id 5C53EFCF0C63; Tue, 14 Apr 2009 07:25:36 +0200 (CEST) Received: from [78.43.226.218] (helo=frosties.localdomain) by smtp08.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #277) id 1Ltb9K-0001Uy-00; Tue, 14 Apr 2009 07:25:36 +0200 Received: from mrvn by frosties.localdomain with local (Exim 4.69) (envelope-from ) id 1Ltb97-0005UU-Ev; Tue, 14 Apr 2009 07:25:21 +0200 From: Goswin von Brederlow To: Lukasz Stafiniak Cc: Christoph Bauer , Basile STARYNKEVITCH , Caml Subject: Re: [Caml-list] OCaml and Boehm References: <4a708d20904101313s49ef3b75m45202b6bda800b77@mail.gmail.com> <49E066E5.8060107@starynkevitch.net> <4a708d20904110511o7d390807r3d29400cf96d6f35@mail.gmail.com> <49E09C2D.4080906@starynkevitch.net> <4a708d20904110711i199ef805h611a04d823c8fb51@mail.gmail.com> <49E0B15C.6080208@starynkevitch.net> <87bpr0khzm.fsf@christoph-bauer.net> <4a708d20904130615x120ff744m9211997c5f53b1aa@mail.gmail.com> Date: Tue, 14 Apr 2009 07:25:20 +0200 In-Reply-To: <4a708d20904130615x120ff744m9211997c5f53b1aa@mail.gmail.com> (Lukasz Stafiniak's message of "Mon, 13 Apr 2009 15:15:25 +0200") Message-ID: <8763h7g62n.fsf@frosties.localdomain> User-Agent: Gnus/5.110006 (No Gnus v0.6) XEmacs/21.4.21 (linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: goswin-v-b@web.de X-Sender: goswin-v-b@web.de X-Provags-ID: V01U2FsdGVkX1+BxxXIk2zWt3tF9TaQ/vnVnPbAdWDH8OAps/jX sFeAylpdnzCKTqlpT8VzDRBJS87X6eUW1HA944Fn+ZHMt5keRf 0aExFpTxk= X-Spam: no; 0.00; ocaml:01 boehm:01 lukasz:01 basile:01 basile:01 objs:01 objs:01 ocaml:01 pointers:01 boehm:01 pointers:01 malloc:01 finalizer:01 2009:98 mfg:98 Lukasz Stafiniak writes: > On Mon, Apr 13, 2009 at 11:42 AM, Christoph Bauer > wrote: >> Basile STARYNKEVITCH writes: >> >>> My advice is always to avoid mixing several garbage collection >>> techniques or implementations inside the same program. >>> >> >> TCL uses refcounted Tcl_Objs. We use these Tcl_Objs in OCaml for a long >> time. And it works excellent. >> >> So I guess,  it's easier to use smart pointers. >> > I'll restate my question: is it the same deal with Boehm, or is it > really more difficult with Boehm? I'm not talking about Boehm starting > from Caml roots -- this would be too difficult I guess (?), although > the only way to get back the full performance. Instead, just as with > smart pointers: every wrapper would register a Boehm-GC root with > GC_MALLOC_UNCOLLECTABLE, and a finalizer would deregister it with > GC_FREE. A performance hit, but at least doesn't hit the C++ code. > > Thanks in advance. > Łukasz That would work. But only allows data to go in one direction. That way Ocaml can use pointers into the Boehm heap but you can not use pointers into the ocaml heap. MfG Goswin