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=1.9 required=5.0 tests=AWL,DNS_FROM_RFC_POST, SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id F399FBBC4 for ; Sun, 12 Apr 2009 14:09:07 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsYBALp24UnRVdyuimdsb2JhbACVcz8BAQEKCQwHDwWgeYEJjhIBAwEDg3kG X-IronPort-AV: E=Sophos;i="4.40,175,1238968800"; d="scan'208";a="38349438" Received: from mail-fx0-f174.google.com ([209.85.220.174]) by mail4-smtp-sop.national.inria.fr with ESMTP; 12 Apr 2009 14:09:07 +0200 Received: by fxm22 with SMTP id 22so1638238fxm.9 for ; Sun, 12 Apr 2009 05:09:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=O5L0HaxX812bzKs4bEnkx14u67098h64ncAcZpmMBXY=; b=n9XntCViLdCl5LeRZu0f82bgXz1nNOeOohAyuJaJVVrpV6NcYJukV18Ezw2ngdQDo1 zMf76AKLRSSmwwPB6YE+MDTEdHoRPbegj0oqUidmTxQbppaE42bMq2/fa9RZ/H17CCVY 66D3hgjWSvPG0BMmbEz8xxWc/E4Fpk3+NtNEk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=jGZpT49X9afYai0NZ7IY7PTgmGSp6D/OszqPxmornw7qmQkibEvlPYGKsiLrmzxrHt MX90XPiouXHHFhi2l9kMWyFTQOKYwNqvUq+o9RH8aHFwFPvNRz42mAXweT8N1rFok1Qz G65eyzQW2H8FzmNK11gXYjnbs9mqm43/sKc4s= MIME-Version: 1.0 Received: by 10.223.116.72 with SMTP id l8mr1480860faq.33.1239538147517; Sun, 12 Apr 2009 05:09:07 -0700 (PDT) In-Reply-To: <873acelf3n.fsf@frosties.localdomain> References: <4a708d20904101313s49ef3b75m45202b6bda800b77@mail.gmail.com> <49E066E5.8060107@starynkevitch.net> <873acelf3n.fsf@frosties.localdomain> Date: Sun, 12 Apr 2009 14:09:07 +0200 Message-ID: <4a708d20904120509k3b09cdadj63a48f8383298568@mail.gmail.com> Subject: Re: [Caml-list] OCaml and Boehm From: Lukasz Stafiniak To: Goswin von Brederlow Cc: Basile STARYNKEVITCH , Caml Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ocaml:01 boehm:01 lukasz:01 pointers:01 ocaml:01 boehm:01 pointers:01 2009:98 wrote:01 caml-list:01 roots:02 allocated:02 bytes:03 apr:06 pointing:06 On Sun, Apr 12, 2009 at 5:34 AM, Goswin von Brederlow wrote: > > Correct me if I'm wrong but aren't pointers in ocaml always pointing > inside allocated memory instead of its begining? Each block has a > header and the ocaml value points to after the header. So every ocaml > value would be 4/8 bytes offset to the real address of a block. > > Can Boehm cope with that at all? Boehm is only supposed to collect the C(++)land values. One can register the OCaml-boxed pointers that refer to these values as Boehm-GC roots, and deregister them (?) in the OCaml-finalizers for the pointers. I don't see anything scary with this approach, provided (?) is possible. Is the performance penalty as big as with smart pointers?