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 MAA10449; Sun, 1 Jun 2003 12:54:23 +0200 (MET DST) 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 MAA10825 for ; Sun, 1 Jun 2003 12:54:21 +0200 (MET DST) Received: from smtp4.wanadoo.nl (smtp4.wanadoo.nl [194.134.35.175]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h51AsKT17658 for ; Sun, 1 Jun 2003 12:54:20 +0200 (MET DST) Received: from wanadoo.nl (rot2-p0658.dial.wanadoo.nl [62.234.200.146]) by smtp4.wanadoo.nl (Postfix) with ESMTP id CB7E73E650; Sun, 1 Jun 2003 12:54:18 +0200 (CEST) Message-ID: <3ED9DA78.4040601@wanadoo.nl> Date: Sun, 01 Jun 2003 12:50:32 +0200 From: Maas-Maarten Zeeman User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020623 Debian/1.0.0-0.woody.1 X-Accept-Language: en MIME-Version: 1.0 To: Chris Hecker Cc: "Mary F. Fernandez" , caml-list@inria.fr, Jerome Simeon Subject: Re: [Caml-list] Question about register_global_root References: <3ED511E5.8060401@research.att.com> <4.3.2.7.2.20030601002350.01cf4310@localhost> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; caml-list:01 hecker:01 malloc:01 sizeof:01 val:01 interfacing:01 implemented:01 chris:01 caml:01 unit:03 wrote:03 explicitly:03 init:05 handlers:06 root:07 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Chris Hecker wrote: > >> handlers = (value *) malloc(sizeof(value)); >> register_global_root(handlers); > > > Shouldn't you init *handlers to Val_unit before calling > register_global_root() as well? The manual explicitly tells that register_global_root should be called before any valid value is stored in it for the first time, like Val_unit. See Rule 4 of Interfacing C with Objective Caml in the manual. So I think it is ok the way it is implemented. Maas ------------------- 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