Faq in C :
-
register is only hint to compiler! The compiler may ignore this. So, it will created during compile time.
Thanks and Regards, Selvam, http://www.wincpp.com
-
Yes compilation time itself. Actually register storage class specifier indicates to the compiler that the object should be stored in a machine register. Which makes it extremely faster than in physical memory. But with some restrictions For more info just refer the below link :- http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=/com.ibm.xlcpp8l.doc/language/ref/regdef.htm[^]
Величие не Бога может быть недооценена.
-
Yes compilation time itself. Actually register storage class specifier indicates to the compiler that the object should be stored in a machine register. Which makes it extremely faster than in physical memory. But with some restrictions For more info just refer the below link :- http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=/com.ibm.xlcpp8l.doc/language/ref/regdef.htm[^]
Величие не Бога может быть недооценена.
-
Thanks in advance.. How do the compiler know the availability of free registers at compile time? It's practically soundless, when a stack frame is created at runtime how could the register variable is defined at compile time?
madhu_v wrote:
How do the compiler know the availability of free registers at compile time?
Well, I believe that allocating registers is one of the task of a compiler... :rolleyes: Anyway, the
register
keyword is just an hint for the compiler. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
madhu_v wrote:
How do the compiler know the availability of free registers at compile time?
Well, I believe that allocating registers is one of the task of a compiler... :rolleyes: Anyway, the
register
keyword is just an hint for the compiler. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]Yes exactly :)
Величие не Бога может быть недооценена.