English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
OCaml and Boehm
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-04-11 (09:46)
From: Basile STARYNKEVITCH <basile@s...>
Subject: Re: [Caml-list] OCaml and Boehm
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?


Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***