[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: D pointers
From: George Staikos <staikos () kde ! org>
Date: 2005-10-03 21:28:37
Message-ID: 200510031728.37837.staikos () kde ! org
[Download RAW message or body]
On Monday 03 October 2005 16:55, Michael Pyne wrote:
> On Monday 03 October 2005 12:11, George Staikos wrote:
> > On Monday 03 October 2005 05:47, Simon Hausmann wrote:
> > > Besides that it probably doesn't hurt for integers and other primitive
> > > types, but if you have more complex types you still waste constructor
> > > and destructor time on them even if they're unused.
> >
> > You can replace them with POD filler.
>
> How do you ensure that the POD filler is always the same size as the object
> being replaced on all platforms though?
Here's an example from KApplication:
struct oldPixmapType { QPixmap a, b; };
mutable union {
struct {
QPixmap *icon, *miniIcon;
} pm;
char unused[sizeof(oldPixmapType)];
} aIconPixmap; // KDE4: remove me
Here we were even able to reuse the space so we didn't need to add to the
d-pointer.
--
George Staikos
KDE Developer http://www.kde.org/
Staikos Computing Services Inc. http://www.staikos.net/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic