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.5 required=5.0 tests=MAILTO_TO_REMOVE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 2D56EBC6C for ; Thu, 24 Aug 2006 18:49:30 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k7OGnTFk004168 for ; Thu, 24 Aug 2006 18:49:29 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA29245 for ; Thu, 24 Aug 2006 18:49:28 +0200 (MET DST) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k7OGnRej004149 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Thu, 24 Aug 2006 18:49:28 +0200 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1GGINr-0001SZ-FD for caml-list@inria.fr; Thu, 24 Aug 2006 18:48:48 +0200 Received: from 0x5731d08c.bynxx18.adsl-dhcp.tele.dk ([87.49.208.140]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 Aug 2006 18:48:47 +0200 Received: from spam by 0x5731d08c.bynxx18.adsl-dhcp.tele.dk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 Aug 2006 18:48:47 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Bardur Arantsson Subject: Re: memory handling with native code Date: Thu, 24 Aug 2006 18:47:55 +0200 Message-ID: References: <20060824085934.198440@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 0x5731d08c.bynxx18.adsl-dhcp.tele.dk User-Agent: Thunderbird 1.5.0.5 (X11/20060729) In-Reply-To: <20060824085934.198440@gmx.net> Sender: news X-Miltered: at nez-perce with ID 44EDD899.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 44EDD897.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; lib:01 pointer:01 ocaml's:01 pointer:01 ocaml's:01 ffi:01 cheers:01 letterman:98 wrote:01 snip:02 ptr:02 ptr:02 native:02 shared:04 shared:04 Michael Wohlwend wrote: > I'm trying to make an interface to a c++ lib of a friend of me, it's getting better, but questions about > the memory management came up: > Should I wrap the pointer in a custom object? [-- snip mumble about unbroken lines ;) --] Since we're on this subject: I was wondering whether anyone on the list has investigated if it's possible to use the C++ boost::shared_ptr<> or tr1::shared_ptr<> for that matter and OCaml's custom blocks to interoperate so that one can avoid having to do manual custom block/pointer management on the C/C++ side of things? I've always found the manual custom block/pointer management to be one of the more annoying aspects of OCaml's FFI. Cheers, -- Bardur Arantsson - I didn't have a blunt object with me, so I said "OK". David Letterman, 'The Late Show'