I was reading some gstreamer code and fell on this line
register int i;
Does anyone know what the register keyword does ?
I was reading some gstreamer code and fell on this line
register int i;
Does anyone know what the register keyword does ?
Another SO question has already answered this.
Answer From Brian Knoblauch:
It's a hint to the compiler that the variable will be heavily used and that you recommend it be kept in a processor register if possible.
Most modern compilers do that automatically, and are better at picking them than us humans. :-)
So, essentially, it assures the programmer that the compiler will know that the variable will be utilized numerous times and to keep that variable in the CPU register. As stated in the other answer, most compilers do this automatically.