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

Rémi Duraffort ivoire at via.ecp.fr
Wed Jul 2 22:47:54 CEST 2008


> > > 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.
Thanks for both answers.

-- 
ivoire who will go to sleep less stupid than usuall.



More information about the vlc-devel mailing list