[Development] Changing container privates again
Olivier Goffart
olivier at woboq.com
Sat Jun 9 19:31:09 CEST 2012
On Saturday 09 June 2012 19:19:41 Thiago Macieira wrote:
> On sábado, 9 de junho de 2012 19.15.09, Olivier Goffart wrote:
> > I suggest re-ordering the offset in order to avoid padding.
>
> It doesn't help.
>
> > struct Q_CORE_EXPORT QArrayData
> > {
> >
> > QtPrivate::RefCount ref;
> > uint flags;
> > qptrdiff offset; // in bytes from beginning of header
> > int size; // ### move to the main class body?
> > // 4 byte tail padding on 64 bits
> >
> > };
> > // size is 16 / 24 bytes (but really 20 bytes as we could use the tail
> > padding to put the payload already)
> >
> >
> > struct QArrayAllocatedData : public QArrayData
> > {
> >
> > uint alloc;
> >
> > };
> > // size is 20 / 24 bytes (the tail padding bytes are used)
>
> The size here is 20 / 32 bytes. The tail padding bytes are not used.
Ah right... I tought that when inheriting, the padding was used. I was
mistaken.
Then, one can put back 'alloc' in QArrayData
More information about the Development
mailing list