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 QAA15191; Mon, 13 May 2002 16:56:56 +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 QAA19376 for ; Mon, 13 May 2002 16:56:55 +0200 (MET DST) Received: from beaune.inria.fr (beaune.inria.fr [128.93.8.3]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g4DEus920520 for ; Mon, 13 May 2002 16:56:54 +0200 (MET DST) Received: by beaune.inria.fr (8.8.8/1.1.22.3/14Sep99-0328PM) id QAA0000019767; Mon, 13 May 2002 16:56:49 +0200 (MET DST) Date: Mon, 13 May 2002 16:56:49 +0200 (MET DST) From: Damien Doligez Message-Id: <200205131456.QAA0000019767@beaune.inria.fr> To: cq@htec.demon.co.uk, garrigue@kurims.kyoto-u.ac.jp Subject: Re: [Caml-list] NULL as a caml value Cc: caml-list@inria.fr Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >From: Christopher Quinn >> Does it even need to be word aligned? >> If Is_long() tests positive the 'pointer' is also ignored. >> I hope I have not erred!? There are three cases to consider: A. word-aligned B. odd C. equal to 2 modulo 4 >From: Jacques Garrigue >Otherwise, looking at the runtime's source, I see nothing that would >prevent from using any (even non-aligned) pointer outside of the caml >heaps to be cast to a value, but the manual does not allow it >explicitly, so this may mean that such non-aligned even values could >be used for something else. (Actually they are already used for >compaction.) Yes, compaction is the reason why non-aligned pointers are not allowed by the documentation. The compaction code will crash on case C. So you can have it word-aligned, or odd, but not all arbitrary pointers are allowed. Be careful. And compaction is now activated by default (not in 3.04, but in the working version). Don't ask me what happens on 64-bit machines, I'd have to look at the source :-) -- Damien ------------------- 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