Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Troubles with C->Caml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Dmitry Bely <dbely@m...>
Subject: Re: [Caml-list] Troubles with C->Caml
malc <malc@pulsesoft.com> writes:

> > >     result = alloc_small (1, 2);
> > >     Field (result, 0) = <some value>;
> > >     Field (result, 1) = Extract_exception (res);
> > 
> > FAQ. When calling allocating functions, the GC may move the values of
> > the heap. The variable "res", of type "value", is actually a pointer
> > to the heap. After the call to "alloc_small", its pointed value may
> > have been moved by the GC, but "res" still points to the old area.
> 
> Well, the real code contains all the necessary CAMLxxx decorations, and
> yet it still coredumps. And belive me, i read everything i could find
> on the subject before posting the question. Furthermore i found that
> C code in OCaml distribution is very inconsistent w.r.t CAMLxxx macros,
> and its hard to draw any conclusions from there.

Why simply not to use CamlIDL and forget about all this problems forever?

Hope to hear from you soon,
Dmitry


-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr