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 DAA24641; Fri, 16 Jul 2004 03:03:38 +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 DAA24473 for ; Fri, 16 Jul 2004 03:03:37 +0200 (MET DST) Received: from mproxy.gmail.com (rproxy.gmail.com [64.233.170.195]) by concorde.inria.fr (8.12.10/8.12.10) with SMTP id i6G13ZSH014549 for ; Fri, 16 Jul 2004 03:03:36 +0200 Received: by mproxy.gmail.com with SMTP id d78so449313rnf for ; Thu, 15 Jul 2004 18:03:32 -0700 (PDT) Received: by 10.38.207.42 with SMTP id e42mr226247rng; Thu, 15 Jul 2004 18:03:30 -0700 (PDT) Message-ID: Date: Thu, 15 Jul 2004 21:03:29 -0400 From: John Prevost To: caml-list@inria.fr Subject: Re: [Caml-list] Unboxing options, was RE: assertions or exceptions? In-Reply-To: <20040716.093517.95470327.garrigue@kurims.kyoto-u.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <20040716.093517.95470327.garrigue@kurims.kyoto-u.ac.jp> X-Miltered: at concorde with ID 40F72967.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; prevost:01 prevost:01 caml-list:01 unboxing:01 2004:99 jacques:01 caml's:01 pointers:01 -byte:01 aligned:01 assertions:01 garrigue:01 garrigue:01 wrote:03 exceptions:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 16 Jul 2004 09:35:17 +0900 (JST), Jacques GARRIGUE wrote: > The idea is just to reserve a sufficiently large memory area to > represent every needed (Some (Some ...(Some None) ...)). Apologies for keeping the conversation going, but since I just thought of this: Caml's internal pointers are at minimum 4-byte aligned. What about using the other "safe" set of trailing bits, "10", to mark options? i.e.: None = ...0010 (2) Some None = ...0110 (6) Some Some None = ...1010 (10) Some Some Some None = ...1110 (14) and so on? This would remove the need to use a special memory area (or check that area) for wrapping and unwrapping. There'd still be a cost, but I would think it should be smaller than the cost you describe? That said, I also don't think this is a critical issue. John. ------------------- 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