possiblity of overlapping of function stack frames

Discussion in 'C++' started by Good Guy, Jun 28, 2013.

  1. Good Guy

    Good Guy Guest

    Hello
    I encountered following info at this page:

    For some purposes, the stack frame of a subroutine and that of its caller can be considered to overlap, the overlap consisting of the area where the parameters are passed from the caller to the callee. In some environments, the caller pushes each argument onto the stack, thus extending its stack frame, then invokes the callee. In other environments, the caller has a preallocated area at the top of its stack frame to hold the arguments it suppliesto other subroutines it calls. This area is sometimes termed the outgoing arguments area or callout area. Under this approach, the size of the area is calculated by the compiler to be the largest needed by any called subroutine.

    So may a C++ compiler do such thing in case of following function (assumingit's not inline of course and only variables in local scopes of callers ofthis function are passed as arguments to this function) or any function atall?

    void foo(int & ref){ref++;}
    Good Guy, Jun 28, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. MrThingy
    Replies:
    2
    Views:
    353
    Samee Zahur
    Apr 30, 2005
  2. Surinder Singh
    Replies:
    1
    Views:
    1,177
    Richard Bos
    Dec 20, 2007
  3. Mel
    Replies:
    6
    Views:
    430
    MLightsOut
    Aug 28, 2009
  4. Casey Hawthorne
    Replies:
    3
    Views:
    1,065
    Flash Gordon
    Nov 1, 2009
  5. Good Guy
    Replies:
    1
    Views:
    152
    Bart van Ingen Schenau
    Jun 28, 2013
Loading...

Share This Page