Can Q_GLOBAL_STATIC replace KStaticDelete ?

Alexander Neundorf neundorf at kde.org
Mon Jan 22 23:39:00 GMT 2007


On Tuesday 23 January 2007 00:29, Thiago Macieira wrote:
> Thiago Macieira wrote:
> >>+static bool _k_static_##NAME##_destroyed = false;
> >
> >Don't initialise the variable. This saves us 4 bytes in the executable.
>
> Forget what I said above. The compiler is smart enough to know that
> initialising to 0 is the same as placing on the .bss. So, by all means,
> initialise it.

Sure ? I didn't know that. All versions of gcc ? In all optimization levels ? 
For variables of which types ?

Thanks for any pointers
Alex
-- 
Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de
Home: neundorf AT kde.org                - http://www.kde.org
      alex AT neundorf.net               - http://www.neundorf.net




More information about the kde-core-devel mailing list