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 SAA13574 for caml-red; Mon, 14 Aug 2000 18:39:03 +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 KAA16192 for ; Fri, 11 Aug 2000 10:58:49 +0200 (MET DST) Received: from air.irisa.fr (air.irisa.fr [131.254.60.130]) by concorde.inria.fr (8.10.0/8.10.0) with ESMTP id e7B8wmv10821 for ; Fri, 11 Aug 2000 10:58:48 +0200 (MET DST) Received: from parate.irisa.fr (parate.irisa.fr [131.254.12.25]) by air.irisa.fr (8.9.3/8.9.3) with ESMTP id KAA13000; Fri, 11 Aug 2000 10:58:47 +0200 (MET DST) To: Markus Mottl Cc: Nicolas Joliot , caml-list@inria.fr Subject: Re: =?iso-8859-1?q?Interfa=E7age?= C/CAML References: <3992D2D9.906E0BA7@irisa.fr> <20000810191404.A21178@miss.wu-wien.ac.at> From: David.Mentre@irisa.fr (David=?iso-8859-1?q?_Mentr=E9?=) Date: 11 Aug 2000 10:58:47 +0200 In-Reply-To: Markus Mottl's message of "Thu, 10 Aug 2000 19:14:04 +0200" Message-ID: User-Agent: Gnus/5.0805 (Gnus v5.8.5) Emacs/20.6 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: weis@pauillac.inria.fr 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 : http://caml.inria.fr/archives/200002/msg00074.html I hope it helps, d. -- David.Mentre@irisa.fr -- http://www.irisa.fr/prive/dmentre/ Opinions expressed here are only mine.