From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 3D036BC8E for ; Fri, 18 Feb 2005 16:27:42 +0100 (CET) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.202]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j1IFRegB017302 for ; Fri, 18 Feb 2005 16:27:41 +0100 Received: by rproxy.gmail.com with SMTP id a36so8357rnf for ; Fri, 18 Feb 2005 07:27:40 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=GaN1cEebnRaxinZOZhTD++APmjX/7MTi6m0t8idhoeSGZoiJ+r5LD7h2IshvhuY53qCNc5ZV6Mswo4RA81JoWRQiz6VpP84KMzyZ9ClNCrupC4VvDmCyl9fDW7wh7I8maH8upT471ydRVJDb1DouaXHfeZOcFugiKTQyOc47Q7A= Received: by 10.39.2.37 with SMTP id e37mr42223rni; Fri, 18 Feb 2005 07:27:39 -0800 (PST) Received: by 10.38.65.58 with HTTP; Fri, 18 Feb 2005 07:27:39 -0800 (PST) Message-ID: <7f8e92aa050218072728529280@mail.gmail.com> Date: Fri, 18 Feb 2005 17:27:39 +0200 From: Radu Grigore Reply-To: Radu Grigore To: Jon Harrop Subject: Re: [Caml-list] Right recursion with ocamlyacc Cc: caml-list@yquem.inria.fr In-Reply-To: <7f8e92aa0502160118388588b4@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <200502160210.46048.jon@jdh30.plus.com> <20050216035811.GA17612@mobile> <200502160435.23574.jon@jdh30.plus.com> <7f8e92aa0502160118388588b4@mail.gmail.com> X-Miltered: at nez-perce with ID 4216096C.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 recursion:01 ocamlyacc:01 wrote:01 parsing:01 stack:01 model:01 stl:01 iirc:01 reuse:01 structures:01 msvc:01 data:02 btw:02 simplest:02 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.2 X-Spam-Level: On Wed, 16 Feb 2005 11:18:21 +0200, Radu Grigore wrote: > In parsing.ml you will find a function approprately named growstacks. And, BTW the stack size is doubled which is not a very good strategy. With the simplest memory model (one contiguous segment) one can see that if the array is allocated first at address 0 and then at the lowest address that can hold it then the base address will keep increasing. This assumes that there aren't other big data structures in memory that get collected. The same issue prompted a change in the implementation of STL in MSVC 7.0. IIRC the grow factor was reduced from 2 to 1.5. In theory to allow reuse it is sufficient to use a factor less than the golden ration. -- regards, radu http://rgrig.idilis.ro/