[Qt-interest] On overriding qMalloc in QVector
Thiago Macieira
thiago at kde.org
Thu Oct 22 19:43:24 CEST 2009
Em Quinta-feira 22 Outubro 2009, às 16:40:07, você escreveu:
> We need to pass the alignment requirements from the compiler to the
> allocator function. So we need a qMallocAligned function.
Unfortunately, that won't work.
I managed to get an aligned QVector data, but the change is not data-
compatible.
If I put this change in Qt 4.6, then we could have newly-compiled code
allocating aligned buffers passing a QVector to code that wasn't recompiled. If
that older code tried to free the vector, the application would most likely
crash.
I think I can safely make the change for QMap and QHash though. QList isn't
affected by this issue, while QLinkedList cannot be solved properly (it uses
new on QLinkedListNode<T>).
--
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: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091022/9dc951ae/attachment.bin
More information about the Qt-interest-old
mailing list