[Development] Changing container privates again

Thiago Macieira thiago.macieira at intel.com
Sat Jun 9 19:19:41 CEST 2012


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.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120609/fe9fe2ce/attachment.sig>


More information about the Development mailing list