Version française
Home     About     Download     Resources     Contact us    
Browse thread
int_of_string bug
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] int_of_string bug
On Fri, 2007-03-30 at 09:30 +0200, Florian Weimer wrote:
> * Yaron Minsky:
> 
> > That's a problem too, but there is at least a defensible reason for
> > that, which is that it is expensive to get integer overflow to throw
> > an exception.
> 
> i386 and amd64 have hardware support for that, so it's not very
> expensive.  There are pretty short RISC sequences for the checks, too.
> 
> MLton uses the i386 hardware support, and I think you can disable the
> checks, so measuring the overhead shouldn't be too hard.

But there is a difference you may have missed: Ocaml integers
are 31 or 63 bits, not 32 or 64 bits. 

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net