From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA24353; Fri, 22 Feb 2002 15:27:49 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 PAA25731 for ; Fri, 22 Feb 2002 15:27:43 +0100 (MET) Received: from fichte.ai.univie.ac.at (fichte.ai.univie.ac.at [131.130.174.156]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g1MERfv00612 for ; Fri, 22 Feb 2002 15:27:41 +0100 (MET) Received: from chopin.ai.univie.ac.at (root@chopin.ai.univie.ac.at [131.130.174.170]) by fichte.ai.univie.ac.at (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id PAA19059; Fri, 22 Feb 2002 15:27:41 +0100 Received: (from markus@localhost) by chopin.ai.univie.ac.at (8.9.3/8.9.3/Debian 8.9.3-21) id PAA22717; Fri, 22 Feb 2002 15:27:41 +0100 Date: Fri, 22 Feb 2002 15:27:41 +0100 From: Markus Mottl To: Winfried Dreckmann Cc: OCAML Subject: Re: [Caml-list] local root registration Message-ID: <20020222142741.GA22329@chopin.ai.univie.ac.at> Mail-Followup-To: Winfried Dreckmann , OCAML References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.26i Organization: Austrian Research Institute for Artificial Intelligence Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 22 Feb 2002, Winfried Dreckmann wrote: > I agree that they are easiest if one strictly follows the rules in the > documentation. However, I would like to point out that there are cases > where one does not want to do this. In these cases, the older macros > (Begin_roots and End_roots) are much more flexible, and can even lead > to better code. Yes, to me they also seem more approriate at times. > I will discuss this a little. Perhaps the Begin_roots/End_roots macros > should not be deprecated, but left as a low level alternative? I can't remember that there were intentions to remove them. They rather seem to be discouraged in favour of the new scheme whenever the latter can be applied without tradeoffs. > In one case the documentation already differs between a simple and a > low level interface, and I believe this is a good approach. What do > other list members think? There should certainly be an efficient way to conditionally protect roots, which cannot be done with the new macro scheme. Furthermore, to my knowledge there is currently no way to allocate and raise more complex exceptions with "mlraise" without using the older macros. > (see "lib/common/ml-alloc.h" in the numerix distribution). In this way, > the price for garbage collection is only paid if allocation actually > takes place. It seems impossible to achieve the same effect with > CAMLxxx macros. If I am not seriously mistaken, only allocations on the OCaml-heap can trigger a collection. There is just a small overhead associated with (un)registering OCaml-values as reachable, but it's certainly a good idea to remove every kind of unnecessary overhead in performance-critical code. Regards, Markus Mottl -- Markus Mottl markus@oefai.at Austrian Research Institute for Artificial Intelligence http://www.oefai.at/~markus ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners