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 BC6FCBBBB for ; Sat, 1 Apr 2006 12:16:55 +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 k31AGtbe026346 for ; Sat, 1 Apr 2006 12:16:55 +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 MAA07520 for ; Sat, 1 Apr 2006 12:16:54 +0200 (MET DST) Received: from rouge.crans.org (rouge.crans.org [138.231.136.3]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k31AGsR8026343 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Sat, 1 Apr 2006 12:16:54 +0200 Received: from localhost (rouge.adm.crans.org [138.231.144.3]) by rouge.crans.org (Postfix) with ESMTP id EF8ABBB67; Sat, 1 Apr 2006 12:16:53 +0200 (CEST) Received: from rouge.crans.org ([138.231.144.3]) by localhost (rouge [138.231.144.3]) (amavisd-new, port 10024) with LMTP id 21126-02-30; Sat, 1 Apr 2006 12:16:53 +0200 (CEST) Received: from [192.168.1.10] (ALille-151-1-30-62.w83-192.abo.wanadoo.fr [83.192.240.62]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by rouge.crans.org (Postfix) with ESMTP id 7CA51BB60; Sat, 1 Apr 2006 12:16:53 +0200 (CEST) Message-ID: <442E5314.9080804@crans.org> Date: Sat, 01 Apr 2006 12:16:52 +0200 From: =?ISO-8859-1?Q?Li-Thiao-T=E9_S=E9bastien?= User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dmitry Bely Cc: caml-list@inria.fr Subject: Re: [Caml-list] Documentation request: allocation of bigarrays in C References: <442D3667.90904@crans.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at crans.org X-Miltered: at concorde with ID 442E5317.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 442E5316.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; bigarrays:01 bigarray:01 pointer:01 pointer:01 bigarray:01 genarray:01 arrays:01 bigarrays:01 ocaml:01 reordering:01 higher-level:01 ocaml:01 parsing:01 wrote:01 caml-list: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 Bely wrote: > sayan@crans.org writes: > >>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? > Why is there a C bigarray allocation function at all then ? :) In my case, I want to read a relatively big file (50MB) containing arrays of floats . I use C functions for the raw speed then pass the bigarrays to OCaml to do some reordering of the data, and higher-level processing. I do not open the file in Ocaml then send a string to C for parsing, but rather open the file in C and return the bigarray list to Ocaml. (cf my previous mistake on creating Ocaml lists in C on this mailing-list) I have hundreds of such files that I may want to load and compare interactively, so reclaiming unused memory is a big bonus. -- Li-Thiao-Té Sébastien