From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA15376 for caml-red; Fri, 11 Aug 2000 10:10:39 +0200 (MET DST) 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 TAA06347 for ; Thu, 10 Aug 2000 19:14:03 +0200 (MET DST) Received: from miss.wu-wien.ac.at (miss.wu-wien.ac.at [137.208.107.17]) by concorde.inria.fr (8.10.0/8.10.0) with ESMTP id e7AHE2523171 for ; Thu, 10 Aug 2000 19:14:02 +0200 (MET DST) Received: (from mottl@localhost) by miss.wu-wien.ac.at (8.9.0/8.9.0) id TAA27967; Thu, 10 Aug 2000 19:14:04 +0200 (MET DST) Date: Thu, 10 Aug 2000 19:14:04 +0200 From: Markus Mottl To: Nicolas Joliot Cc: caml-list@inria.fr Subject: Re: =?iso-8859-1?Q?Interfa=E7age_C=2FCAML?= Message-ID: <20000810191404.A21178@miss.wu-wien.ac.at> References: <3992D2D9.906E0BA7@irisa.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Mutt/1.2i In-Reply-To: <3992D2D9.906E0BA7@irisa.fr>; from Nicolas.Joliot@irisa.fr on Thu, Aug 10, 2000 at 18:05:45 +0200 Sender: weis@pauillac.inria.fr [Francais] (Excusez-moi mon francais faible) On Thu, 10 Aug 2000, Nicolas Joliot wrote: > Lorsqu'elles sont appel=E9es s=E9par=E9ment, je peux afficher les resulats > sans probl=E8me, mais lorsque les deux sont appel=E9es successivement et = que > j'essaye d'afficher le tableau de floatants, j'ai syst=E9matiquement un > "Bus Error". Je ne suis pas sur, mais ca peut-etre un problem entre l'interface de C et le GC... > - d=E9claration : CAMLlocal1(tableau_float) > - allocation : tableau_float=3Dalloc(nb_element*2,Double_array_tag) > - Utilisation :Store_double_field(tableau_float,i,floatant_a_renvoyer) > _ retour sous CAML par CAMLreturn Si je le comprends bien, le problem c'est l'utilisation du "Store_double_field". La solution dans ce cas serait d'essayer le macro "Double_field" en place de l'autre macro. C'est souvant un source des erreurs - peut-etre on pourrait changer le nom de "Store_double_field"? Il me semble que la plupart des programmeurs soient confuses par "Store"... "Store_..." ne doit etre utilise que avec des "blocs structures", ou il sont obligatoirs. Amicalement, Markus Mottl --------------------------------------------------------------------------- [English] It seems that a common bug has struck again: using "Store_{whatever}" in C-interfaces is only allowed (and then mandatory) with structured blocks. Using it for anything else may crash the GC. Maybe we could change the names of the "Store_..."-macros so that people don't mistakenly believe that these are generally the right ones to "store" values? Something like "Store_Block_..." or similar (less verbose)? Best regards, Markus Mottl --=20 Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl