From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA31742; Fri, 15 Oct 2004 15:20:04 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA31640 for ; Fri, 15 Oct 2004 15:20:03 +0200 (MET DST) Received: from [128.93.8.158] (macaque.inria.fr [128.93.8.158]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i9FDJxgx010530; Fri, 15 Oct 2004 15:19:59 +0200 Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: References: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Message-Id: Content-Transfer-Encoding: quoted-printable From: Damien Doligez Subject: Re: [Caml-list] OCaml-3.08.1/MinGW: alloc_tuple fails Date: Fri, 15 Oct 2004 15:20:00 +0200 To: "Bauer, Christoph" , caml users X-Mailer: Apple Mail (2.619) X-Miltered: at nez-perce with ID 416FCE7F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; damien:01 damien:01 caml-list:01 mingw:01 alloc:01 bauer:01 camlprim:01 camlparam:01 camllocal:01 alloc:01 val:01 camlreturn:01 val:01 initialized:01 caml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Oct 14, 2004, at 15:23, Bauer, Christoph wrote: > CAMLprim value test( value _ ) > { > =A0 CAMLparam1( _ ); > =A0 CAMLlocal1( t ); > =A0 int i; > =A0 t =3D alloc_tuple( 100 ); > =A0 for( i=3D0 ; i < 100; ++i ) > =A0=A0=A0 Store_field( t, i, Int_val ( i )); > =A0 CAMLreturn ( Val_unit ); > } You are not supposed to use Store_field on a value that is not yet initialized. You should write this instead: caml_initialize (&Field (t, i), Val_int (i)); -- Damien ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners