André Pönitz wrote:
> On Sunday 16 October 2011 18:57:44 ext Thiago Macieira wrote:
>>> [...]
>>> One thing I would like to add is the hash, for QString (and potentialy
>>> QByteArray)
>>> see: http://qt.gitorious.org/qt/qtbase/merge_requests/62
>> 
>> We discussed that but we're not satisfied that it will provide good results. 
>> It 
>> means spending 4 bytes to store the hash as well as hardcoding the hashing 
>> function until Qt 6. Someone mentioned that only 10% of the strings are ever 
>> hashed. In particular, I am not ready to give up a 16-byte alignment for the 
>> hashing.
> 
> Re "hash": Can't the hash be put at ((char*)data)[-4] (plus the necessary
> adjustments)?
> 
> Re "QList-and-QVector" merge: I'd really like to see reference counting
> _removed_ from QVector. We do need _one_ easy-to-use-no-overhead 
> container. That probably make that merge harder....

I don't think we can remove reference counting from QVector. That said, I do 
want to give you access to a non-reference-checked version of it. This would be 
available on detach, probably through the use of a private base class:

    template <class T> QUncheckedVector { ... QVectorData<T> *d; };
    template <class T> QVector : private QUncheckedVector<T> { ... 
QUncheckedVector & detach(); ... };

I have a toy implementation of the above, but haven't tried to bring it into 
Qt, yet. AFAICS, this would allow give you (or allow you to access) the best of 
both worlds.

Cheers,


João

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

Reply via email to