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. Advertisements

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:
    429
    Samee Zahur
    Apr 30, 2005
  2. Surinder Singh
    Replies:
    1
    Views:
    1,438
    Richard Bos
    Dec 20, 2007
  3. Mel
    Replies:
    6
    Views:
    592
    MLightsOut
    Aug 28, 2009
  4. Casey Hawthorne
    Replies:
    3
    Views:
    1,382
    Flash Gordon
    Nov 1, 2009
  5. Debajit Adhikary
    Replies:
    36
    Views:
    3,077
    Andre Kaufmann
    Feb 10, 2011
  6. Sam Roberts
    Replies:
    1
    Views:
    355
    Yukihiro Matsumoto
    Feb 11, 2005
  7. Kenneth McDonald

    Why stack overflow with such a small stack?

    Kenneth McDonald, Aug 30, 2007, in forum: Ruby
    Replies:
    7
    Views:
    506
    Kenneth McDonald
    Sep 1, 2007
  8. Good Guy
    Replies:
    1
    Views:
    293
    Bart van Ingen Schenau
    Jun 28, 2013
Loading...