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 LAA31374; Mon, 13 May 2002 11:05:50 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 LAA31337 for ; Mon, 13 May 2002 11:05:49 +0200 (MET DST) Received: from t2.fast.net.uk (ns1.fast.net.uk [212.42.162.2]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g4D95n902518 for ; Mon, 13 May 2002 11:05:49 +0200 (MET DST) Received: from htec.demon.co.uk (adsl-212-42-169-63.fast.net.uk [212.42.169.63]) by t2.fast.net.uk (8.11.6/8.11.4) with ESMTP id g4D95Ss29576; Mon, 13 May 2002 10:05:30 +0100 (BST) Message-ID: <3CDF8FEE.7040505@htec.demon.co.uk> Date: Mon, 13 May 2002 11:05:34 +0100 From: Christopher Quinn User-Agent: Mozilla/5.0 (compatible; MSIE5.5; Windows 98; X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jacques Garrigue CC: caml-list@inria.fr Subject: Re: [Caml-list] NULL as a caml value References: <20020512234522.A5687@kruuna.Helsinki.FI> <20020513162035N.garrigue@kurims.kyoto-u.ac.jp> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Jacques Garrigue wrote: > From: Lauri Alanko > >>The docs weren't very clear on this, so I just wanted to check: is >>(value)NULL a legal caml value? Checking from the sources, it seems that the >>GC does leave alone all pointers that don't point to within the caml-managed >>heap. However, the docs state that only "memory allocated by malloc" can be >>turned directly into an abstract caml value. So may I rely on NULL working? >>It would ease dealing with many C interfaces. > > > Yes, NULL is valid, as are all word-aligned addresses outside of the > Caml heap. Does it even need to be word aligned? If Is_long() tests positive the 'pointer' is also ignored. I hope I have not erred!? - chris ------------------- 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