From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id A55D4BC69 for ; Fri, 30 Mar 2007 10:44:38 +0200 (CEST) Received: from ipmail02.adl2.internode.on.net (ipmail02.adl2.internode.on.net [203.16.214.141]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2U8iau0024582 for ; Fri, 30 Mar 2007 10:44:37 +0200 Received: from ppp36-111.lns2.syd6.internode.on.net (HELO [192.168.1.201]) ([59.167.36.111]) by ipmail02.adl2.internode.on.net with ESMTP; 30 Mar 2007 18:14:34 +0930 X-IronPort-AV: i="4.14,352,1170595800"; d="scan'208"; a="104166833:sNHT23842833" Subject: Re: [Caml-list] int_of_string bug From: skaller To: Florian Weimer Cc: Yaron Minsky , Oliver Bandel , caml-list@inria.fr In-Reply-To: <878xdfmbm8.fsf@mid.deneb.enyo.de> References: <891bd3390703290927o4e1c6bb5gf8f562fedbc70096@mail.gmail.com> <20070329212931.GG6843@first.in-berlin.de> <891bd3390703291726ue71cfa6re8d4c3d66520e4d9@mail.gmail.com> <878xdfmbm8.fsf@mid.deneb.enyo.de> Content-Type: text/plain Date: Fri, 30 Mar 2007 18:44:31 +1000 Message-Id: <1175244271.22118.10.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 460CCDF4.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bug:01 0200,:01 yaron:01 minsky:01 ocaml:01 integers:01 sourceforge:01 wrote:01 integer:01 exception:01 caml-list:01 short:01 int:01 string:02 florian:03 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 Felix, successor to C++: http://felix.sf.net