[Qt5-feedback] Real 64 Bit support ?

Keith Gardner kgardner at zebraimaging.com
Thu May 12 15:36:52 CEST 2011


Or, could we just have a QVector and QVector64?  Then those who have a QVector don't experience any memory overhead and those who need the extra memory can use a different version.  This is also cross platform when serializing.

Keith

-----Original Message-----
From: qt5-feedback-bounces+kgardner=zebraimaging.com at qt.nokia.com [mailto:qt5-feedback-bounces+kgardner=zebraimaging.com at qt.nokia.com] On Behalf Of Andre Somers
Sent: Thursday, May 12, 2011 8:32 AM
To: qt5-feedback at qt.nokia.com
Subject: Re: [Qt5-feedback] Real 64 Bit support ?

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é


_______________________________________________
Qt5-feedback mailing list
Qt5-feedback at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback


More information about the Qt5-feedback mailing list