From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.2 required=5.0 tests=AWL,SPF_SOFTFAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 71D5DBBAF for ; Tue, 16 Jun 2009 11:44:21 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0BAE0GN0rBvsFKl2dsb2JhbACYUAEBAQEBCBUHuUKEDQU X-IronPort-AV: E=Sophos;i="4.42,227,1243807200"; d="scan'208";a="28163278" Received: from dnsp.umh.ac.be (HELO hermes1.umh.ac.be) ([193.190.193.74]) by mail2-smtp-roc.national.inria.fr with ESMTP; 16 Jun 2009 11:44:21 +0200 Received: from poincare.swapping.umh.ac.be (poincare.swapping.umh.ac.be [10.102.100.76]) by hermes1.umh.ac.be (8.14.2/8.13.6) with ESMTP id n5G9fqK61278196; Tue, 16 Jun 2009 11:41:52 +0200 Received: from localhost ([127.0.0.1] ident=trch) by poincare.swapping.umh.ac.be with esmtp (Exim 4.69) (envelope-from ) id 1MGVDI-0001Fg-5A; Tue, 16 Jun 2009 11:44:20 +0200 Date: Tue, 16 Jun 2009 11:44:19 +0200 (CEST) Message-Id: <20090616.114419.669093565955563034.Christophe.Troestler+ocaml@umons.ac.be> To: christoph.bauer@lmsintl.com Cc: OCaml Mailing List Subject: Re: [Caml-list] C Interface and float record From: Christophe TROESTLER In-Reply-To: References: X-Face: #2fb%mPx>rRL@4ff~TVgZ"<[:,oL"`TUEGK/[8/qb58~C>jR(x4A+v/n)7BgpEtIph_neoLKJBq0JBY9:}8v|j Organization: University of Mons X-Mailer: Mew version 6.2.51 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 193.190.193.76 X-Spam: no; 0.00; christophe:01 troestler:01 christophe:01 troestler:01 ocaml:01 0200,:01 alloc:01 alloc:01 wosize:01 2009:98 wrote:01 caml-list:01 caml:02 caml:02 external:03 On Tue, 16 Jun 2009 10:40:31 +0200, Christoph Bauer wrote: > > type t = { > f1 : float; > f2 : float; > f3 : float; > } > > and a external C-function should allocate this as for the result. > > Do I have to use > > caml_alloc(6, Double_array_tag) caml_alloc(3 * Double_wosize, Double_array_tag) would be better (portable between 32 and 64 bits). C.