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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id DB5F8BC6B for ; Wed, 28 Nov 2007 20:33:20 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah4FACRRTUeAKgEfbGdsb2JhbACPPgsEBhAZ X-IronPort-AV: E=Sophos;i="4.23,225,1194217200"; d="scan'208";a="19781376" Received: from mail.cs.rice.edu ([128.42.1.31]) by mail4-smtp-sop.national.inria.fr with ESMTP; 28 Nov 2007 20:33:20 +0100 Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id 32A6B2C2CA4; Wed, 28 Nov 2007 13:33:19 -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 M6WcpSov7Lp4; Wed, 28 Nov 2007 13:33:18 -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 4A2892C2C99; Wed, 28 Nov 2007 13:33:18 -0600 (CST) Message-ID: <474DC28D.1060605@rice.edu> Date: Wed, 28 Nov 2007 13:33:33 -0600 From: Raj User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Xavier Leroy Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Disabling the OCaml garbage collector References: <474C48C5.708@starynkevitch.net> <474DADF7.5020204@rice.edu> <474DB454.9060507@inria.fr> In-Reply-To: <474DB454.9060507@inria.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ocaml:01 pointers:01 indirection:01 bindings:01 garbage:01 wrote:01 caml-list:01 caml:02 caml:02 roots:02 roots:02 python:03 correctly:04 problem:05 raj:05 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. Regards Raj 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 >