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=1.0 required=5.0 tests=AWL,SPF_FAIL autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 6D831BC0B for ; Tue, 26 Dec 2006 19:52:47 +0100 (CET) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by concorde.inria.fr (8.13.6/8.13.6) with SMTP id kBQIqkAM001389 for ; Tue, 26 Dec 2006 19:52:46 +0100 Received: (qmail invoked by alias); 26 Dec 2006 18:52:46 -0000 Received: from p54A32192.dip0.t-ipconnect.de (EHLO [192.168.2.116]) [84.163.33.146] by mail.gmx.net (mp008) with SMTP; 26 Dec 2006 19:52:46 +0100 X-Authenticated: #20477425 Message-ID: <45917013.4060900@fantasymail.de> Date: Tue, 26 Dec 2006 19:55:15 +0100 From: micha User-Agent: Thunderbird 1.5.0.8 (X11/20061115) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] allocating memory for c-structures References: <459166C7.4080005@fantasymail.de> <20061226183547.GA29273@furbychan.cocan.org> In-Reply-To: <20061226183547.GA29273@furbychan.cocan.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Miltered: at concorde with ID 45916F7E.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; allocating:01 pointers:01 pointers:01 avoided:01 ocaml:01 marshalling:01 ocaml:01 marshalling:01 cheers:01 caml-list:01 opaque:01 data:02 structures:02 external:02 external:02 thanks for all the answers. Richard Jones schrieb: > > That seems like it'll work for "opaque" C objects, but it's a bit of a > hack. The immediate issues I can think are: > > (a) Pointers in the C code which point at the object will not be > "counted" by the GC, and so the object may be collected while there > are still C pointers around. This is easily avoided in OCaml, but > read chapter 18 of the manual carefully. > that's true; for linked data structures it would not work (except all would be allocated this way) > Actually, while I was writing the above, it struck me that perhaps > you're talking about some sort of marshalling system? OCaml supports > its own marshalling format, and a rich variety of other external forms > of marshalling. ah no, I just thought that it would be another way to handle external memory. What I didn't realize was, that the gc moves pointers around... cheers Michael