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
Disabling the OCaml garbage collector
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-11-28 (19:33)
From: Raj <rajb@r...>
Subject: Re: [Caml-list] Disabling the OCaml garbage collector

Thank you for the advice, Xavier.

I would highly appreciate any pointers to existing code that does the 
'register_global_roots()' thing.  Examples would definitely help me code 
it correctly.


Xavier Leroy wrote:
> The solution to your problem is to play nice with the Caml GC: on the
> C/Python side, handle Caml "values" through an indirection via a
> malloc-ed block, and register the Caml value contained within this
> block with the Caml GC using register_global_roots(), as Thomas
> Fischbacher outlined.  Members of this list can probably point you to
> some existing C/Caml bindings that does just this and that you could
> use as inspiration.
> Hope this helps,
> - Xavier Leroy