On Monday, 17 de October de 2011 08:25:01 [email protected] wrote:
> Do we really believe we need the 32 flags? We need capacity. sharable is
> only used internally right now (in qiterator.h). Have we thought if there
> are ways to avoid needing it?
> 
> I like the idea of getting the header into 16 bytes at least on 32bit
> platforms. We don't have to be as strict on 64bit IMO, as these platforms
> should usually have some more memory available anyway.

Well, no, we don't need 32 flags today. We only need 2. But who knows what we 
may need in the future? When I introduced the feature of aligned allocation to 
some of the containers, in one of them having access to an unused flag bit 
allowed the implementation to happen.

Using the sign bits is ugly but possible. On x86, x86-64, IA-64 and ARM it 
means one more instruction (one AND), on MIPS it's 3 more (the AND and two 
instructions to load the value 0x7fffffff into a register).

I just unrolled the flags because we had enough space left if we give up trying 
to get to 16 bytes.


The important thing is that the header is a multiple of 8 bytes on 32-bit 
platforms and a multiple of 16 bytes on 64-bit platforms. What we mustn't do 
is a multiple of 8 and not a multiple of 16 (i.e., 24 bytes) on 64-bit 
platforms.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Qt5-feedback mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback

Reply via email to