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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 31164BC57 for ; Wed, 26 May 2010 08:00:44 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvIDAPtV/EvUGyoFe2dsb2JhbACeGhUBARYiAx+/TYUTBA X-IronPort-AV: E=Sophos;i="4.53,302,1272837600"; d="scan'208";a="51216783" Received: from smtp5-g21.free.fr ([212.27.42.5]) by mail3-smtp-sop.national.inria.fr with ESMTP; 26 May 2010 08:00:43 +0200 Received: from smtp5-g21.free.fr (localhost [127.0.0.1]) by smtp5-g21.free.fr (Postfix) with ESMTP id 5D72ED4816F; Wed, 26 May 2010 08:00:37 +0200 (CEST) Received: from [192.168.0.3] (rke75-3-82-229-183-156.fbx.proxad.net [82.229.183.156]) by smtp5-g21.free.fr (Postfix) with ESMTP; Wed, 26 May 2010 08:00:36 +0200 (CEST) Message-ID: <4BFCB903.50608@frisch.fr> Date: Wed, 26 May 2010 08:00:35 +0200 From: Alain Frisch User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.10) Gecko/20100511 Shredder/3.0.6pre MIME-Version: 1.0 To: Romain Beauxis Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Bigarrays and blocking_section.. References: <201005251125.21755.toots@rastageeks.org> In-Reply-To: <201005251125.21755.toots@rastageeks.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; frisch:01 frisch:01 bigarrays:01 pointer:01 malloc:01 malloc:01 alloc:01 bigarray:01 ocaml:01 bigarray:01 ocaml:01 wrote:01 ints:01 caml-list:01 alain:01 On 5/25/2010 6:25 PM, Romain Beauxis wrote: > My understanding is that after the line "frame_of_value(_rgb,&rgb);", the C > object rgb only contains ints and a pointer to a block of memory allocated by > malloc. Did you allocated the C array yourself with malloc? (And then used alloc_bigarray to wrap it as an OCaml bigarray.) Otherwise, if you created the bigarray from OCaml code, you need to keep the bigarray live with some GC root, or the memory for the array can be released. Alain