From 5368155796780511322
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,a69618ea97f65037
X-Google-Attributes: gidf78e5,public
From: "Paul D. DeRocco" <pderocco@ix.netcom.com>
Subject: Re: nested functions
Date: 1998/05/08
Message-ID: <35527806.B15610C5@ix.netcom.com>#1/1
X-Deja-AN: 352011721
X-NNTP-Posting-Host: bst-ma6-22.ix.netcom.com
Content-Transfer-Encoding: 7bit
Approved: stephen.clamage@sun.com (comp.std.c++)
References: <6hac23$8lb$1@news2.isdnet.net> <m3wwck8vtb.fsf@gabi-soft.fr> <353F904F.2EFDC21D@ix.netcom.com> <m34sza9oau.fsf@gabi-soft.fr>
X-UID: 0000000001
X-Status: $$$T
Content-Type: text/plain; charset=us-ascii
Organization: Vast Right-Wing Conspiracy
X-NETCOM-Date: Thu May 07 10:14:26 PM CDT 1998
Mime-Version: 1.0
Newsgroups: comp.std.c++
Originator: clamage@taumet


J. Kanze wrote:
> 
> "Paul D. DeRocco" <pderocco@ix.netcom.com> writes:
> 
> |>  However, allowing recursion is only a small increase in
> |>  complexity. The
> |>  mechanism for remembering the context of the original call (i.e.,
> |>  the
> |>  address of the enclosing stack frame) is well-understood, and is
> |>  even
> |>  built into the x86 ENTER instruction.
> 
> Correct.  But none of the x86 C/C++ compilers I know use this
> instruction, because it costs more time than a simple PUSH EBP; MOV
> EBP,ESP sequence.  (Or has this changed?  It's been some time since I
> last looked at the generated output of a C/C++ compiler on an Intel
> processor.)

No, the compilers I use avoid ENTER/LEAVE. I'm merely saying that the
algorithm is well-known, and that ENTER would probably be more efficient
for nested functions, even though it isn't for non-nested ones.

-- 

Ciao,
Paul


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]




