quote:MSDN C++ language reference: the Register keyword The compiler does not accept user requests for register variables; instead, it makes its own register choices when global register-allocation optimization (/Oe option) is on. However, all other semantics associated with the register keyword are honored.So... does this mean the Register keyword is useless in Visual Studio? What "other semantics" are there, associated with the register keyword? And what does global register-allocation optimization do?
Registers
I''ve been looking into registers a bit, to see if it is possible to speed up some game code. Apparently, one can use the Register keyword to request that a certain variable be stored in a register. This sounds like it would come in handy with some often-accessed variables. Yet, MSDN has the following to say about this:
It means exactly what it says, register is an outdated keyword and most (if not all) modern compilers totally ignore it. Global-register-allocation just means that the compiler knows better than the programmer which values are going to be in which registers at any particular time
register is nowadays seen like "please compiler, if u could put this in a register it would be cool", but it is definetely not seen (by the compilers) as an order... it''s more like a request when not ignored...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement