Version française
Home     About     Download     Resources     Contact us    
Browse thread
AW: [Caml-list] OCaml-3.08.1/MinGW: alloc_tuple fails
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] OCaml-3.08.1/MinGW: alloc_tuple fails
On Thu, Oct 14, 2004 at 04:59:01PM +0200, Bauer, Christoph wrote:
> 
> >  >   t = alloc_tuple( 100 );
> >  >   for( i=0 ; i < 100; ++i )
> >  >     Store_field( t, i, Int_val ( i ));
> > 
> > s/Int_val/Val_int/
> 
> 
> Ok, that's correct. But the problem is before the for-loop.

It looks correct to me, but often memory corruption happens earlier
than is detected.  Try adding a call to Gc.full_major () just before
you call your C function.  If it crashes in the Gc, then you've got
memory corruption, and you'll need to pepper your code with calls to
Gc.full_major () to try and narrow it down.

Hope that helps anyway,

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
Learning Objective CAML for C, C++, Perl and Java programmers:
http://www.merjis.com/richj/computers/ocaml/tutorial/