From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id B387CBB91 for ; Thu, 21 Jul 2005 07:43:45 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j6L5hhpI007468 for ; Thu, 21 Jul 2005 07:43:44 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id HAA08882 for ; Thu, 21 Jul 2005 07:43:43 +0200 (MET DST) Received: from smtp106.sbc.mail.mud.yahoo.com (smtp106.sbc.mail.mud.yahoo.com [68.142.198.205]) by concorde.inria.fr (8.13.0/8.13.0) with SMTP id j6L5hg6r007445 for ; Thu, 21 Jul 2005 07:43:42 +0200 Received: (qmail 39544 invoked from network); 21 Jul 2005 05:43:41 -0000 Received: from unknown (HELO ?192.168.1.100?) (rftp@pacbell.net@63.194.18.166 with plain) by smtp106.sbc.mail.mud.yahoo.com with SMTP; 21 Jul 2005 05:43:41 -0000 Message-ID: <42DF3624.3000502@rftp.com> Date: Wed, 20 Jul 2005 22:44:04 -0700 From: Robert Roessler Organization: Robert's High-performance Software User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 X-Accept-Language: en-us, en MIME-Version: 1.0 To: dmitry grebeniuk , Caml-list Subject: Re: [Caml-list] A pair of "Interfacing with C" questions References: <42DF2A64.4000600@rftp.com> <8210502975.20050721082753@moldavcable.com> In-Reply-To: <8210502975.20050721082753@moldavcable.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 42DF3610.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 42DF360E.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 interfacing:01 grebeniuk:01 drawbacks:01 recompiled:01 afaict:01 sizeof:01 pointers:01 ...:98 ...:98 wrote:01 ints:01 pair:01 opaque:01 dmitry:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 dmitry grebeniuk wrote: > Shalom, Robert. > ... > 2) int32 -- good enough. No limitations and drawbacks of ints/values, > but it is boxed. Thanks, dmitry - but this breaks as soon as the software is recompiled on a 64-bit implementation (AFAICT). :) > 3) custom blocks with size sizeof(yourpointertype). I think it is the > best alternative: you can attach finalization function (and others, if > you will need) to blocks. In this function you can: a) automatically > deallocate C-side objects, b) write debug info about objects that are > not closed properly from Caml-side. Yes, I use custom blocks when their functionality is needed - but here I really just want "opaque pointers"... I only need to store them in a Caml "value" and be able to hand them back across the Caml/C interface on demand. Robert Roessler roessler@rftp.com http://www.rftp.com