From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA23217 for caml-redistribution; Tue, 22 Feb 2000 11:50:37 +0100 (MET) 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 AAA21746 for ; Tue, 22 Feb 2000 00:35:40 +0100 (MET) Received: from ot-link.ot.com.au ([203.5.3.1]) by nez-perce.inria.fr (8.8.7/8.8.7) with SMTP id AAA19596 for ; Tue, 22 Feb 2000 00:35:36 +0100 (MET) Received: (qmail 26642 invoked from network); 21 Feb 2000 23:35:31 -0000 Received: from unknown (HELO druid.in.ot.com.au) (203.5.4.202) by 203.5.3.1 with SMTP; 21 Feb 2000 23:35:31 -0000 Received: (qmail 16319 invoked from network); 21 Feb 2000 23:35:31 -0000 Received: from merlin.in.ot.com.au (HELO in.ot.com.au) (203.5.4.26) by druid.in.ot.com.au with SMTP; 21 Feb 2000 23:35:31 -0000 Sender: weis Message-ID: <38B1CD1C.48963E22@in.ot.com.au> Date: Tue, 22 Feb 2000 10:41:16 +1100 From: Max Skaller Organization: Open Telecommunications Ltd X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 CC: caml-list@inria.fr Subject: Re: Calling C from OCaml, GC problems References: <20000218104523.12491@pauillac.inria.fr> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit > However, the second warning is still there (even if harmless). The > problem is that the caml__dummy_##name variables are no longer > used. Such variable is only used to make some side-effects using C > '(stmt1, stmt2, ..., stmtN)' notation. I see no way to fix this. C lack > the Caml 'let _ ='. :) I'd recommend getting rid of those macros. Anyone writing a CAML/C interface needs to understand details of how the GC works so as to optimise code to exactly the required functions to create temporary roots, etc .. it would be better to provide the raw functions and a good explanation. For example, the documentation says 'it is safe to cast C malloced pointers to caml values' which, in English at least, does NOT tell me what I need to know -- that the caml GC 'knows' that such values are not pointers into it's heap. For example, I did some work on a copy of mlgtk, and the requirements lead to fairly idiosyncractic code -- code wrapping a single simple object never needs to make the temporary roots; but if there are two objects, the first created needs to be rooted. I do wonder if it would not be useful to have a function(s) that did allocations without collecting. -- John (Max) Skaller at OTT [Open Telecommications Ltd] mailto:maxs@in.ot.com.au -- at work mailto:skaller@maxtal.com.au -- at home