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 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 26F06BC6B for ; Wed, 28 Nov 2007 20:29:58 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah4FAHlQTUeAKgEfbGdsb2JhbACPPgsEBhAZ X-IronPort-AV: E=Sophos;i="4.23,225,1194217200"; d="scan'208";a="6282424" Received: from mail.cs.rice.edu ([128.42.1.31]) by mail3-smtp-sop.national.inria.fr with ESMTP; 28 Nov 2007 20:29:57 +0100 Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id 04EFE2C2CD6 for ; Wed, 28 Nov 2007 13:29:55 -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 P8phH1vFXpLy for ; Wed, 28 Nov 2007 13:29:55 -0600 (CST) Received: from dhcp-7-24.cs.rice.edu (dhcp-7-24.cs.rice.edu [128.42.7.24]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id 1D4B62C2CBF for ; Wed, 28 Nov 2007 13:29:55 -0600 (CST) Message-ID: <474DC1BA.4010302@rice.edu> Date: Wed, 28 Nov 2007 13:30:02 -0600 From: Raj User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Caml mailing list Subject: Re: [Caml-list] Disabling the OCaml garbage collector References: <474C48C5.708@starynkevitch.net> <474DADF7.5020204@rice.edu> <474DB04B.30909@frisch.fr> <474DB406.7090104@functionality.de> In-Reply-To: <474DB406.7090104@functionality.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ocaml:01 ocaml:01 mutable:01 garbage:01 wrote:01 caml-list:01 python:03 python:03 passing:05 raj:05 raj:05 suggestions:07 likely:08 function:08 i'm:09 You are absolutely right, Thomas. Internally, my program goes back and forth between Python and OCaml via C, and there can be chains of calls e.g. OCaml -> Python -> OCaml ->... and so on. If I'm passing a reference to a mutable object (e.g. an Array) around these call-chains, I need to make sure the GC doesn't move it around unexpectedly. Thank you for the suggestions, folks. I'll follow them up and see how they work. Regards Raj Thomas Fischbacher wrote: > > Most likely, he calls back into another OCaml function from Python which > does some memory allocation... In real applications, this situation is > practically impossible to avoid. >