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 5FD9ABBBB for ; Fri, 31 Mar 2006 19:59:24 +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 k2VHxNnt008015 for ; Fri, 31 Mar 2006 19:59:24 +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 TAA28637 for ; Fri, 31 Mar 2006 19:59:23 +0200 (MET DST) Received: from mx1.mail.ru (mx1.mail.ru [194.67.23.121]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k2VHxMSB021732 for ; Fri, 31 Mar 2006 19:59:23 +0200 Received: from [64.74.207.50] (port=5546 helo=bely) by mx1.mail.ru with asmtp id 1FPNu3-0005zj-00 for caml-list@inria.fr; Fri, 31 Mar 2006 21:59:22 +0400 Received: from localhost (HELO BELY) [127.0.0.1] by bely (0.0.0.2) with ESMTP (Classic Hamster Vr. 2.0 Build 2.0.0.1) ; Fri, 31 Mar 2006 21:57:24 +0400 X-Comment-To: sayan@crans.org To: caml-list@inria.fr Subject: Re: [Caml-list] Documentation request: allocation of bigarrays in C References: <442D3667.90904@crans.org> From: Dmitry Bely Date: Fri, 31 Mar 2006 21:57:24 +0400 In-Reply-To: <442D3667.90904@crans.org> (sayan@crans.org's message of "Fri, 31 Mar 2006 16:02:15 +0200") Message-ID: User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.5 (windows-nt) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Posting-Agent: Hamster/2.0.0.1 X-Miltered: at concorde with ID 442D6DFC.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 442D6DFA.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; bigarrays:01 bigarray:01 pointer:01 malloc:01 ocaml:01 garbage:01 bigarray:01 pointer:01 genarray:01 caml-list:01 writes:01 dmitry:01 dmitry:01 macros:01 bely:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.8 required=5.0 tests=RCVD_IN_BL_SPAMCOP_NET autolearn=disabled version=3.0.3 sayan@crans.org writes: > Please add the following fact to the Bigarray module documentation (I > had to look at the c source header) and/or correct it as necessary : > > A pointer allocated from C using malloc is not freed by the OCaml > garbage collector. Of course - it's not possible in general. > If you want to be GC-friendly, use the bigarray > allocation macros with a NULL pointer to allocate memory then get a > pointer to the data array. If you need GC-controlled bigarray, why simply not to use Bigarray.Genarray.create? - Dmitry Bely