From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id B9C1CBC6B for ; Tue, 27 Nov 2007 17:28:24 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAACLUS0eAKgEfkmdsb2JhbACPPgEBAQEHBAYpgQ4 X-IronPort-AV: E=Sophos;i="4.23,220,1194217200"; d="scan'208";a="19739476" Received: from mail.cs.rice.edu ([128.42.1.31]) by mail4-smtp-sop.national.inria.fr with ESMTP; 27 Nov 2007 17:28:24 +0100 Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id E5B522C2C2A; Tue, 27 Nov 2007 10:28:22 -0600 (CST) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id jIVF7UT+e4kf; Tue, 27 Nov 2007 10:28:22 -0600 (CST) Received: from [128.42.7.24] (dhcp-7-24.cs.rice.edu [128.42.7.24]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id 16B6E2C2C1C; Tue, 27 Nov 2007 10:28:22 -0600 (CST) Mime-Version: 1.0 (Apple Message framework v750) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Raj Bandyopadhyay Subject: Disabling the OCaml garbage collector Date: Tue, 27 Nov 2007 10:28:33 -0600 To: caml-list@yquem.inria.fr X-Mailer: Apple Mail (2.750) X-Spam: no; 0.00; ocaml:01 ocaml:01 camlparam:01 garbage:01 garbage:01 macros:01 short:01 python:03 python:03 module:03 raj:05 raj:05 interface:06 interface:06 function:08 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! Raj