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-27 (16:28)
From: Raj Bandyopadhyay <rajb@r...>
Subject: Disabling the OCaml garbage collector
Dear all

I am writing a foreign function interface between OCaml and another  
language (Python) which works via C. Since I have some memory issues  
currently, I would like to be able to disable the OCaml Garbage  
collector before jumping into C/Python, and re-enable it when I  
return to OCaml.

I am using the OCaml/C interface and the macros that it provides to  
manage values (CAMLlocal and CAMLparam), but I would like to be able  
to disable the GC entirely for short periods.

What facilities does OCaml provide to disable/enable the garbage  
collector? I looked at the GC module and didn't see anything obvious.  
It's fine if it is something at the C level rather than the OCaml level.

Thanks for your help!