Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Does Caml have slow arithmetics ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Brown <caml-list@d...>
Subject: Re: [Caml-list] Does Caml have slow arithmetics ?
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.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: