POV-Ray : Newsgroups : povray.off-topic : Error mesage : Re: Error mesage Server Time
7 Sep 2024 21:15:06 EDT (-0400)
  Re: Error mesage  
From: Darren New
Date: 2 May 2008 12:52:34
Message: <481b46d2$1@news.povray.org>
Warp wrote:
>   From the compiler's point of view the implementation of this is rather
> simple: All the function parameters are pushed onto the stack, and then
> the foo() function simply pops them from the stack. 

Well, technically, the foo() function indexes into the stack (with a 
compiler-provided macro to move the stack pointer into a pointer 
variable, basically), and then whoever called foo() has to pop the 
arguments. Which is one reason you don't see many "ret N" instructions 
in compiled C code - the callee never knows how many arguments the 
caller pushed.  (Altho you'd think that's something the compiler could 
optimize if you didn't have a variable numbers of arguments for a 
particular function.)

-- 
   Darren New / San Diego, CA, USA (PST)
     "That's pretty. Where's that?"
          "It's the Age of Channelwood."
     "We should go there on vacation some time."


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.