S
sensei
I have recently encountered an old code in K&R style which declared
function parameters as register. That puzzles me, and I know this is
implementation defined, and depends on architecture, compiler and so
on. But my question is, how can be a parameter made "faster" (6.7.1,
with note 103).
On Intel and similar implementations all parameters are, as far as I
know, pushed into the stack. On PPC they can be passed through
registers.
Can someone clarify the use of this keyword and how it may work for
function parameters in a real-world example with "faster access" than a
normal parameter?
I know this is, again, implementation defined, but I am not interested
in a particular compiler or architecture, I am curious about *some*
examples of them, if any.
Thanks!
function parameters as register. That puzzles me, and I know this is
implementation defined, and depends on architecture, compiler and so
on. But my question is, how can be a parameter made "faster" (6.7.1,
with note 103).
On Intel and similar implementations all parameters are, as far as I
know, pushed into the stack. On PPC they can be passed through
registers.
Can someone clarify the use of this keyword and how it may work for
function parameters in a real-world example with "faster access" than a
normal parameter?
I know this is, again, implementation defined, but I am not interested
in a particular compiler or architecture, I am curious about *some*
examples of them, if any.
Thanks!