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 04971BC6B for ; Wed, 28 Nov 2007 19:24:05 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAABhBTUfU436umGdsb2JhbACPPgEBAQEHBAQTGA X-IronPort-AV: E=Sophos;i="4.23,225,1194217200"; d="scan'208";a="6280674" Received: from moutng.kundenserver.de ([212.227.126.174]) by mail3-smtp-sop.national.inria.fr with ESMTP; 28 Nov 2007 19:24:05 +0100 Received: from [152.78.96.56] (babylon.cip.physik.uni-muenchen.de [141.84.136.30]) by mrelayeu.kundenserver.de (node=mrelayeu7) with ESMTP (Nemesis) id 0ML2xA-1IxRZq3b4Q-0006KV; Wed, 28 Nov 2007 19:24:04 +0100 Message-ID: <474DB406.7090104@functionality.de> Date: Wed, 28 Nov 2007 18:31:34 +0000 From: Thomas Fischbacher User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20060607 Debian/1.7.12-1.2 X-Accept-Language: en MIME-Version: 1.0 To: Alain Frisch Cc: Raj , 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> In-Reply-To: <474DB04B.30909@frisch.fr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX18lzZg1OXorWQAPmdZHkrGSsBaiMs/XPGic9bK dvaJNI6AGfVqmg3bt1ggyqXnptn59gU92FfMJBGCo8pImfhCfn u6CnQGElqFqP/Cmj40AVg== X-Spam: no; 0.00; ocaml:01 frisch:01 mutable:01 ocaml:01 garbage:01 wrote:01 caml-list:01 alain:01 explicitly:02 caml:02 caml:02 in-place:02 objects:02 allocated:02 python:03 Alain Frisch wrote: >> The issue for me is that I need to be able to modify mutable objects >> in OCaml (eg. array-modification in-place) from both OCaml and >> C/Python. However, the OCaml GC moves things around while the >> execution is in C/Python and this crashes my program. > > Are you sure? > > The OCaml GC is triggered only when Caml memory blocks are allocated > (from Caml or C code) or when you call it explicitly. 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. -- best regards, Thomas Fischbacher tf@functionality.de