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 7036DBC37 for ; Wed, 28 Oct 2009 19:20:07 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Al0GAKco6EpQW+UMgGdsb2JhbACbQAEBFCZHAwEBvieEPwSBYQ X-IronPort-AV: E=Sophos;i="4.44,641,1249250400"; d="scan'208";a="37158430" Received: from lo.gmane.org ([80.91.229.12]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 28 Oct 2009 19:19:46 +0100 Received: from list by lo.gmane.org with local (Exim 4.50) id 1N3D7Z-0005mS-QK for caml-list@inria.fr; Wed, 28 Oct 2009 19:19:45 +0100 Received: from ks300734.kimsufi.com ([91.121.65.225]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 28 Oct 2009 19:19:45 +0100 Received: from sylvain by ks300734.kimsufi.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 28 Oct 2009 19:19:45 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Sylvain Le Gall Subject: Re: How to read different ints from a Bigarray? Date: Wed, 28 Oct 2009 18:19:24 +0000 (UTC) Message-ID: References: <87eiond3of.fsf@frosties.localdomain> <87639zd0m9.fsf@frosties.localdomain> <87tyxj5rkv.fsf@frosties.localdomain> X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ks300734.kimsufi.com User-Agent: slrn/pre1.0.0-11 (Linux) Sender: news X-Spam: no; 0.00; le-gall:01 bigarray:01 le-gall:01 compiler:01 syntax:01 bigarray:01 stubs:01 wrote:01 wrote:01 ints:01 functions:01 unsafe:01 int:01 int:01 writes:01 On 28-10-2009, Goswin von Brederlow wrote: > Sylvain Le Gall writes: >> On 28-10-2009, Goswin von Brederlow wrote: >>> Sylvain Le Gall writes: >>>> On 28-10-2009, Goswin von Brederlow wrote: > >>> PS: Is a.{i} <- x a C call? >> >> Yes. > > That obviously sucks. I was hoping since the compiler has a special > syntax for it it would be built-in. Bigarray being a seperate module > should have clued me in. > > That obviously speaks against splitting int64 into 8 bytes and calling > a.{i} <- x for each. > > I think I will implement your method and C stubs for every set/get and > compare. This is only the case with int64 array in fact (I really have done test and you don't need a C call in most case). Moreover, as Xavier suggests, Array1.unsafe_get/set seems nice. I would however try to find a way to avoid writing too many set/get_{uint*} functions. This can be a nighmare to maintain. Regards, Sylvain Le Gall