Re: Calling C from OCaml, GC problems

From: Damien Doligez (Damien.Doligez@inria.fr)
Date: Wed Feb 23 2000 - 20:39:34 MET

  • Next message: Max Skaller: "Re: Portability of applications written in OCAML: C stuff"

    >From: Max Skaller <maxs@in.ot.com.au>
    >
    >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



    This archive was generated by hypermail 2b29 : Thu Feb 24 2000 - 14:53:09 MET