[vlc-devel] commit: Cosmetics (replace defines by pointers) (Laurent Aimar )

Rémi Denis-Courmont rdenis at simphalempin.com
Wed Jul 2 22:44:55 CEST 2008


Le mercredi 2 juillet 2008 23:33:27 Rémi Duraffort, vous avez écrit :
> > Cosmetics (replace defines by pointers)
>
> Stupid question. Why is it better to use pointer rather than defines ?

A pointer value is computed once and stored to the variable (on the stack, or 
maybe even in a CPU register). A macro will be evaluated again and again, and 
cause derefences again and again... in theory. Of course, the compiler will 
_likely_ optimize the common sub-expression, so there will _likely_ be no 
differences.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list