From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 732A7BC57 for ; Wed, 26 May 2010 08:47:11 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvIDAMNg/EvZSMDje2dsb2JhbACeGhUBARYiAx+/UIUTBA X-IronPort-AV: E=Sophos;i="4.53,302,1272837600"; d="scan'208";a="63427735" Received: from fmmailgate02.web.de ([217.72.192.227]) by mail4-smtp-sop.national.inria.fr with ESMTP; 26 May 2010 08:47:10 +0200 Received: from smtp05.web.de ( [172.20.4.166]) by fmmailgate02.web.de (Postfix) with ESMTP id 3B006162E7488; Wed, 26 May 2010 08:47:10 +0200 (CEST) Received: from [78.43.204.177] (helo=frosties.localdomain) by smtp05.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #4) id 1OHAOU-0003Tv-00; Wed, 26 May 2010 08:47:10 +0200 Received: from mrvn by frosties.localdomain with local (Exim 4.71) (envelope-from ) id 1OHAOT-0003k8-H7; Wed, 26 May 2010 08:47:09 +0200 From: Goswin von Brederlow To: Alain Frisch Cc: Romain Beauxis , caml-list@yquem.inria.fr Subject: Re: [Caml-list] Bigarrays and blocking_section.. References: <201005251125.21755.toots@rastageeks.org> <4BFCB903.50608@frisch.fr> Date: Wed, 26 May 2010 08:47:09 +0200 In-Reply-To: <4BFCB903.50608@frisch.fr> (Alain Frisch's message of "Wed, 26 May 2010 08:00:35 +0200") Message-ID: <87typvf9ci.fsf@frosties.localdomain> User-Agent: Gnus/5.110009 (No Gnus v0.9) XEmacs/21.4.22 (linux, no MULE) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: goswin-v-b@web.de X-Sender: goswin-v-b@web.de X-Provags-ID: V01U2FsdGVkX1+UCDznBT7nXAa44DG3UQ9+l+VsdelsvkgJCU7p f2AL33hWHDZppAYwV225rw3rcmFV/OB7cE0DV1LFXsk3ATtWWV 7rWsDp8zc= X-Spam: no; 0.00; bigarrays:01 frisch:01 frisch:01 pointer:01 malloc:01 malloc:01 alloc:01 bigarray:01 ocaml:01 bigarray:01 ocaml:01 mfg:98 wrote:01 ints:01 caml-list:01 Alain Frisch writes: > 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 He did declare it as local varaible with the proper makro I believe. MfG Goswin