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 TAA14909; Wed, 7 Jul 2004 19:06:16 +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 TAA15289 for ; Wed, 7 Jul 2004 19:06:15 +0200 (MET DST) Received: from mail.davidb.org (adsl-64-172-240-129.dsl.sndg02.pacbell.net [64.172.240.129]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i67H6DSH012280 for ; Wed, 7 Jul 2004 19:06:14 +0200 Received: from davidb by mail.davidb.org with local (Exim 3.36 #1 (Debian)) id 1BiFs3-0006QQ-00; Wed, 07 Jul 2004 10:06:11 -0700 Date: Wed, 7 Jul 2004 10:06:11 -0700 From: David Brown To: Olivier P?r?s Cc: caml-list@inria.fr Subject: Re: [Caml-list] Does Caml have slow arithmetics ? Message-ID: <20040707170611.GA24565@davidb.org> References: <20040707130016.GA27591@bourg.inria.fr> <40EC122C.3040300@laposte.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40EC122C.3040300@laposte.net> User-Agent: Mutt/1.5.4i X-Miltered: at concorde with ID 40EC2D85.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 caml-list:01 arithmetics:01 2004:99 word-aligned:01 pointers:01 aligned:01 ignores:01 ocaml:01 ocaml:01 caml:01 0200,:01 polymorphic:01 olivier:02 pointer:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Jul 07, 2004 at 05:09:32PM +0200, Olivier P?r?s wrote: > But there is no way to be sure that a pointer you got from C is > word-aligned. Consider, for example, a smart user sending you a string > with the first character chopped off : this pointer has an odd LSB. And > C hackers like to do that kind of things. Xavier Leroy obviously knows > this, so I must have missed something. The only pointers that ocaml "cares" about (in the sense of the GC or polymorphic compare) are those that are allocated on the ocaml heap. These values will always be aligned. Whenever the gc or friends sees a pointer, it checks a bitmap of pages to determine if this pointer was ocaml allocated. If not, it ignores it completely. Dave ------------------- 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