From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 25A86BC57 for ; Wed, 31 Mar 2010 19:21:46 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtgBAFshs0tKfVI2kWdsb2JhbACRD4odCBUBAQEBCQkMBw8ksG6BbIVFLYhMAQEDBYR7BIMe X-IronPort-AV: E=Sophos;i="4.51,342,1267398000"; d="scan'208";a="60019508" Received: from mail-ww0-f54.google.com ([74.125.82.54]) by mail4-smtp-sop.national.inria.fr with ESMTP; 31 Mar 2010 19:21:45 +0200 Received: by wwb24 with SMTP id 24so228773wwb.27 for ; Wed, 31 Mar 2010 10:21:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:content-type; bh=bB3TvF+i8zXiYPrHsOmUQ4RoaCiGtRz/PiucVlmNq8I=; b=AHtE05Qd5vggtpmgMtEqpDSH8sT0iQDYfsSk9V8bt1Fj/D8bO8e0tbSAhAf+G/O8Ic JHMSnE1nYG3QbtcP9bhbXO9ubeThETyCJTmQn4dw34wn1LC4rcNJJHnhlXKQ8T8ql6+1 XpldyKeZHRkRwzfj6qGoRClNoWsw2j00brQ0c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=I46z8HxHZ48f4vaqDydxyP4aWr/k4LQ5rsql4YknhD0BIca9/pNijNCzA3/0eLLlzj ln3IfhBm9VJ4e8rXzhME3BeKsZwWmd4r/su1Jt7JpdbVYPd59XJKCbBmzH4UUEQiATIt qEohzdaL9EyQq6FoOlfPIug2kgOGphac4DP9c= MIME-Version: 1.0 Received: by 10.216.88.147 with HTTP; Wed, 31 Mar 2010 10:21:45 -0700 (PDT) In-Reply-To: <4A9F9015.2010408@inria.fr> References: <4A9F9015.2010408@inria.fr> Date: Wed, 31 Mar 2010 21:21:45 +0400 Received: by 10.216.91.6 with SMTP id g6mr275518wef.37.1270056105649; Wed, 31 Mar 2010 10:21:45 -0700 (PDT) Message-ID: Subject: Re: [Caml-list] Optimizing Float Ref's From: Dmitry Bely To: Caml List Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; ref's:01 ref's:01 unboxed:01 compiler:01 unboxed:01 val:01 ocaml:01 2009:98 wrote:01 dmitry:01 dmitry:01 caml-list:01 bely:01 bely:01 float:03 On Thu, Sep 3, 2009 at 1:44 PM, Xavier Leroy wrote: (...) >> But, I thought that float ref's were automatically unboxed by the compiler >> when they didn't escape the local context. > > Yes, if all uses of the float ref are unboxed, which is the case in > your code. let max_val (a:float array) = let m = ref min_float in for i = 0 to (Array.length a) - 1 do if a.(i) > !m then m := a.(i) done; !m !m is not unboxed (Ocaml 3.11). Should it? - Dmitry Bely