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: 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} ***
_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs