[Qt5-feedback] Real 64 Bit support ?
Thiago Macieira
thiago at kde.org
Tue May 17 15:09:09 CEST 2011
On Tuesday, 17 de May de 2011 12:35:20 Andre Somers wrote:
> Op Di, 17 mei, 2011 11:17 am, schreef Thiago Macieira:
> > Of course you cannot load more than 2^32 items into a container on
> > 32-bit, so
> > your question is not relevant.
>
> That's the whole point: where in Qt 4, I am sure I am able to load a file
> that was written with another Qt 4 program, I am not certain anymore of
> that in this setup. I understand that you can make the wire format always
I don't think that's relevant.
You already cannot load 2^30 elements (even a QByteArray of them) on a system
with 256 MB of RAM, even if it's a 64-bit system (think MIPS64 embedded).
You have to take care of the memory size *anyway*. The fact that the file may
contain more elements than your addressable memory is irrelevant.
> use a 64 bit format. But it means that actually trying to read in such a
> format may result in crashes. Handling errors in working with QDataStream
> is tricky enough as it is (basically, impossible, as far as I got with
> it). How do you suggest we deal with this then? By first manually writing
> out the number of elements, and then again with the actual container
> streaming operator? How does a user of the QDataStream API know the limits
> of what can and can't be read in?
I suggest you design your application so that this works. If you need to read
more elements than you have RAM available, you'll be in trouble anyway,
regardless of the size of the int that holds the count.
For example, use chunks of elements, with predetermined size. That is, page in
the elements you need, page out those you don'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: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt.nokia.com/pipermail/qt5-feedback/attachments/20110517/8b64e9ea/attachment.bin
More information about the Qt5-feedback
mailing list