From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a1a88c4d509f6381 X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: scope and/or parameters (beginner) Date: 1999/04/13 Message-ID: <7eujii$55q$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 465750870 References: <37064309.889106243@news.dsuper.net> <37084459.8616007@rocketmail.com> <370b0c99.1137352783@news.dsuper.net> <7ei04q$o$1@nnrp1.dejanews.com> <7et4vr$sdj$1@nnrp1.dejanews.com> X-Http-Proxy: 1.0 x3.dejanews.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Tue Apr 13 05:09:43 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-04-13T00:00:00+00:00 List-Id: In article <7et4vr$sdj$1@nnrp1.dejanews.com>, dennison@telepath.com wrote: > It was claimed here at work that nested subroutines > should be avoided due to the elaboration overhead > whenever the outer routine is called. That sounds a > bit shaky to me. Is there a situation where there would > be a runtime impact of nesting subroutines? Sounds dubious as a general claim, but there is one situation in which you will see overhead in GNAT (GNU C) and that is if you create an access to (use & on) the nested procedure. In this case a trampoline is built in the stack, and the overhead can be significant. In GNAT (but not GNU C) it would be possible to eliminate this overhead by using fat pointers, and that is on our optimizations-that-would-be-nice-to-so-sometime list. A quite long list, which does however, get entries taken off it frequently for actual implementation. But note that this overhead is ONLY if the address is taken, not in the normal case! -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own