[Gdal-dev] Format limitations in 64-bit architecture

Mateusz Loskot mateusz at loskot.net
Wed Feb 28 15:49:14 EST 2007


Mateusz Loskot wrote:
> Simon Perkins wrote:
>>> 
>>> What about other formats such as NITF and MEM?  Because the data
>>>  type size_t in a 32-bit system is defined as a 4-byte type, 
>>> whereas in a 64-bit system it is defined as an 8-byte.   Does 
>>> this mean the MEM format is not limited to 2 GB anymore once we 
>>> work in the 64-bit system?
>> That would seem like a reasonable assumption though I don't know 
>> for sure. I would think that NITF should be able to handle larger 
>> than 4GB files even on 32-bit OSes, on any modern filesystem.
> 
> Yes, I think it's correct too.

Unfortunately, this assumption above *may* be incorrect.
Big Thanks to Norman Vine, who enlighten me about NITF format, and told
that the size limit depends on size of pointer type used by C++ streams.
The C++ standard specifies general requirements about type of file
pointer used by streams, but the type size is not fixed there.

All constraints like type used to represent stream position
(traits::pos_type) and offset (traits::off_type).
and others, are determined by char_traits used during instantiation
of particular stream type.
Finally, position/offset in streams (not only file stream) is
convertible to integral type with sign (sic).

According to the C++ standard, behavior of pos_type and off_type
are implementation defined.

Assuming the C++ standard doesn't define 64 bit integers, maximum
value of pos_type or off_type can be maximum value of int type,
so these values are different on different platforms as well.

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net



More information about the Gdal-dev mailing list