Developers and getting them to improve their code.

Benjamin Meyer kde-optimize@mail.kde.org
Thu, 9 Jan 2003 09:58:42 -0500


On Thursday 09 January 2003 2:17 am, Harri Porten wrote:
> On Wed, 8 Jan 2003, Werner Trobin wrote:
> > On Wednesday 08 January 2003 21:28, Zack Rusin wrote:
> > > On Wednesday 08 January 2003 15:13, Benjamin Meyer wrote:
> > > > > I _guess_ the dtor was added to allow future extensibility. The
> > > > > Q_OBJECT looks necessary to me though, because without it it wo=
uld
> > > > > be impossible to use signals/slots in a class derived from the =
uic
> > > > > generated one, or?
>
> I can make the change to ommit the empty destructor (if we come to some
> agreement re the benefit). But as the Q_OBJECT macro also has the purpo=
se
>  of supplying a className() definition it's not easy to remove without
> breaking people's code. How about extra command line arguments ?

It would only remove ther Q_OBJECT marcro if the generated file was a=20
constructor and had no signals and no slots.  Why would you need the=20
className() function for those classes?

> > Removing the (empty) implementation of a virtual destructor might eve=
n
> > decrease the performance! The compiler puts a generated version of th=
e
> > destructor in every translation unit where it needs it, so you might =
end
> > up with a bigger binary size.
>
> Hmmmm. But removing empty destructors was one of the things that Apple =
did
> in kjs. Hmmm again. Have to check if they also removed the virtual keyw=
ord
> in the base class.

Seems good to me.  Probably would be best for us to find a gcc/compiler=20
developer to give us a difinitive answer on what is better.  Anyone havea=
 =20
gcc contact?

> Harri.
>
> _______________________________________________
> Kde-optimize mailing list
> Kde-optimize@mail.kde.org
> http://mail.kde.org/mailman/listinfo/kde-optimize