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 7E727BBAF for ; Sat, 11 Apr 2009 11:46:14 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkEIAD8D4Ek+BBBqYGdsb2JhbACBUZRaHyUDsmCDfAY X-IronPort-AV: E=Sophos;i="4.38,431,1233529200"; d="scan'208";a="27495898" Received: from smtp-106-saturday.nerim.net (HELO kraid.nerim.net) ([62.4.16.106]) by mail1-smtp-roc.national.inria.fr with ESMTP; 11 Apr 2009 11:46:14 +0200 Received: from hector.lesours (ours.starynkevitch.net [213.41.244.95]) by kraid.nerim.net (Postfix) with ESMTP id 831AECF0B4; Sat, 11 Apr 2009 11:46:13 +0200 (CEST) Received: from glinka.lesours ([192.168.0.1]) by hector.lesours with esmtp (Exim 4.69) (envelope-from ) id 1LsZmy-0007qI-PZ; Sat, 11 Apr 2009 11:46:16 +0200 Message-ID: <49E066E5.8060107@starynkevitch.net> Date: Sat, 11 Apr 2009 11:46:13 +0200 From: Basile STARYNKEVITCH User-Agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Lukasz Stafiniak Cc: Caml Subject: Re: [Caml-list] OCaml and Boehm References: <4a708d20904101313s49ef3b75m45202b6bda800b77@mail.gmail.com> In-Reply-To: <4a708d20904101313s49ef3b75m45202b6bda800b77@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; basile:01 basile:01 ocaml:01 boehm:01 lukasz:01 ocaml:01 runtime:01 boehm:01 traversing:01 ocaml's:01 patched:01 runtime:01 malloc:01 malloc:01 libc:01 Lukasz Stafiniak wrote: > Hi, > > Is the OCaml runtime Boehm-safe? That is, can it be run with Boehm > turned on and traversing OCaml's heap? (So that the OCaml heap can > provide roots to Boehm.) And if not, could it be patched to make it > Boehm-safe in this sense? > > Probably not. Because I am not sure of what you mean by Boehm-safe, since Boehm's GC is conservative and do not make much promises. And very probably, Ocaml runtime cannot realistically be make Boehm-safe or even Boehm compatible. There is a reason for all this. The major strength of Ocaml runtime is its robustness and its efficiency. The efficiency of Ocaml GC is of paramount importance (it supports very high allocation rate, which is out of reach for the Boehm collector; and big allocation rate is typical of most functional programs; the typical allocation speed within the Ocaml runtime is at least one or two order of magnitudes faster than that of GC_malloc; a typical GC_malloc is by itself a bit slower than a libc malloc.). However, it could happen that you might run some Boehm GC code inside Ocaml if you are lucky. You should be sure that no pointer go from GC-Boehm zone into Ocaml zone. But your question is really too vague. What is the Boehm-GC based code you want to run within an Ocaml application, and what is that application? Regards. -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basilestarynkevitchnet mobile: +33 6 8501 2359 8, rue de la Faiencerie, 92340 Bourg La Reine, France *** opinions {are only mines, sont seulement les miennes} ***