[Qt-interest] On overriding qMalloc in QVector

Thiago Macieira thiago at kde.org
Thu Oct 22 09:22:15 CEST 2009


Em Quinta-feira 22. Outubro 2009, às 01.12.09, Benoit Jacob escreveu:
> I'm pleading that I shouldn't have had to examine Qt source code so
> closely to do something that is a standard feature e.g. in the STL!

Qt is not STL nor does purport to replace it completely. There are many 
features in STL that are not in Qt and also vice-versa: many features in Qt 
tool classes not present in STL.

Qt tool classes do not support custom allocators. That feature cannot be added 
until Qt 5, so any discussion is tabled for now.

In any case, QVector<T>::Data contains one element of type T. I suggest using 
compiler extensions to change the alignment of said type, like GCC's 
__attribute__((aligned(N))).

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091022/26bee477/attachment.bin 


More information about the Qt-interest-old mailing list