Re: Is there stack associated when a executing an inline function?
- From: jacob navia <jacob@xxxxxxxxxx>
- Date: Fri, 29 Feb 2008 20:08:52 +0100
Micah Cowan wrote:
jacob navia <jacob@xxxxxxxxxx> writes:
Keith Thompson wrote:jacob navia <jacob@xxxxxxxxxx> writes:Yes. See the definition of local variables and local storage...Mahesh wrote:How do you know? Can you cite the standard to support this claim?I need to know if stack frames are generated in case of aA stack <frame> will not be generated but any local
inline function execution or
do they execute just like macros?
storage that the inline function uses will be added to
the local storage of the calling function.
The implementation you describe is certainly plausible, but the6.2.4.4
standard says nothing about stack frames, either for inline functions
or for ordinary functions.
An object whose identifier is declared with no linkage and without the
storage-class specifier static has automatic storage duration
Normally, objects with automatic storage duration are implemented
in the stack. Of course, regulars do not accept the fact that 99%
of all machines around use a stack but I really do not care.
None of which goes even close to validating your assertion that a
stack frame will _not_ be generated.
A "stack frame" consists of a pushed former stack frame pointer,
and a new stack frame pointer that it is hold in a dedicated register
This is done in all functions at function startup modulo some weird
systems that use other methods; have no stack; run in a coffee
machine that has no hardware stack pointer or in the famous DS9.
It would be completely weird that in an inline procedure the compiler
would save the current stack pointer and establish a new stack
frame since there is no function call.
Of course you can say now (like all "regulars" do in similar situations
"Weird but not impossible!"
And I would have to say
YES. It is not impossible that a compiler establishes 53765
stack frames and then pops 53765 stack frames after the inlined
function call.
Otherwise I would like to know a compiler that generates a
stack frame without generating a function call. Please give me
a single example.
OK?
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
.
- Follow-Ups:
- Re: Is there stack associated when a executing an inline function?
- From: Kaz Kylheku
- Re: Is there stack associated when a executing an inline function?
- References:
- Is there stack associated when a executing an inline function?
- From: Mahesh
- Re: Is there stack associated when a executing an inline function?
- From: jacob navia
- Re: Is there stack associated when a executing an inline function?
- From: Keith Thompson
- Re: Is there stack associated when a executing an inline function?
- From: jacob navia
- Re: Is there stack associated when a executing an inline function?
- From: Micah Cowan
- Is there stack associated when a executing an inline function?
- Prev by Date: Re: calculating length of an substring
- Next by Date: Re: Is there stack associated when a executing an inline function?
- Previous by thread: Re: Is there stack associated when a executing an inline function?
- Next by thread: Re: Is there stack associated when a executing an inline function?
- Index(es):
Relevant Pages
|