Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Interfaçage C/CAML
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David.Mentre@i...
Subject: Re: Interfaçage C/CAML
Markus Mottl <> writes:

> 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.

I would say that Store_{whatever} macros are useful for data structures
that are created in the C-world but should be managed (and destroyed) in
the OCaml-world, WITHOUT any further access on the data by the C
part. For all other cases, use the Field_{whatever} macros. With this
macro, the OCaml GC won't try to have a look at your C data structures.

By the way, Markus has already found a bug like this in my own code. See
this message for further details on how the bug is triggered :

I hope it helps,
-- --
 Opinions expressed here are only mine.