Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Re: Calling C from OCaml, GC problems
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Damien Doligez <Damien.Doligez@i...>
Subject: Re: Calling C from OCaml, GC problems
>From: Max Skaller <>
>I'd recommend getting rid of those macros. Anyone writing
>a CAML/C interface needs to understand details of how the GC
>works so as to optimise code to exactly the required
>functions to create temporary roots, etc .. it would be better
>to provide the raw functions and a good explanation.

Even with the raw functions and a perfect understanding of the system,
I found it extremely difficult to write bug-free code, and very
time-consuming to fish out the inevitable bugs.  That's why the macros
exist.  For most people, it is more economical to write slightly less
efficient code if that means less debugging time and fewer bugs in the
released version.

>I do wonder if it would not be useful to have a function(s)
>that did allocations without collecting.

If only we knew how to do that, we could get rid of the GC
altogether.  (tongue in cheek)

-- Damien