[Qt5-feedback] Real 64 Bit support ?
Andre Somers
andre at familiesomers.nl
Thu May 12 15:31:42 CEST 2011
Op Do, 12 mei, 2011 2:53 pm, schreef Yves Bailly:
> Le 12/05/2011 14:42, André Pönitz a écrit :
>> On Thursday 12 May 2011 13:58:48 ext Keith Gardner wrote:
>>> I would also like to see this. On top of a 64-bit build, I would like
>>> to see
>>> the container classes (QVector, QList, etc...) have a qint64 to index
>>> the
>>> values instead of a qint32.
>>
>> qint64 is expensive on (at least some) 32 bit machines.
>
> True.
>
>> Having _different_ sizes (32/64 bit) depending on architecture spoils
>> cross-platform data exchange using e.g. QDataStream. So that's even
>> less of an option.
>
> Data exchange implies serializing things in a very controlled way, isn't
> it?
> I avoid sending a mere "int" through a QDataStream, I always cast it to a
> known-size type, e.g. int32_t or int64_t (depending on the needs). I would
> treat "size_t" just the same way, so no data exchange problem.
Errr... How do you see that happening? What happens if the data in that
stream as 2^34 elements, and you try to read it in on a 32 bits platform?
But I _can_ see that there may be cases where you'd like to have more
space. Dare I suggest that perhaps the Qt container classes should be
templated with respect to their index type? Default would still be
Q_INT32, but you could pass in Q_INT64 if needed?
QList<MyType> myNormalList;
QList<MyType, Q_INT64> myHugeList;
or something like that?
André
More information about the Qt5-feedback
mailing list