V
Vashna
Hi Group,
I have a doubt about register variables.
I know that if we have a variable used very frequently in a function,
then provided we never apply the & function to it, we can define it as a
register variable and this will make it much faster to access.
Now the question is: obviously there are only a fixed number of
registers in our CPU, maybe 6 or something. So how do we choose which
variables to define as register variables? Obviously things like loop
counters or frequently accessed pointers we must define as register, but
what other criteria do people use?
Thanks.
I have a doubt about register variables.
I know that if we have a variable used very frequently in a function,
then provided we never apply the & function to it, we can define it as a
register variable and this will make it much faster to access.
Now the question is: obviously there are only a fixed number of
registers in our CPU, maybe 6 or something. So how do we choose which
variables to define as register variables? Obviously things like loop
counters or frequently accessed pointers we must define as register, but
what other criteria do people use?
Thanks.