Type sizes in the Legion system

Greg Lindahl, March 20 1997

How do we deal with type sizes in Legion? Consider objects such as the FileObject: the interface says that the maximum size of the file is an 'int'. A more proper specification for this size would be the standard Unix type size_t. But size_t is 8 bytes on an alpha and 4 bytes in most Unixes.

If we nail down ints (and size_t) to 32 bits, LegionFile objects will be limited to 4 gigs in size, in an era where OSes are going to be 64 bits. If we make "size_t" the natural size on the machine, then 32-bit machines will not be able to read files bigger than 4 gigs. This would be bad. In addition, user objects would have no consistant way of programming their way around this limitation.

If we assume most people use compilers which understand "long long", we could make a type "legion_size_t" which was 64 bits on all architectures. This is what we have chosen to do. Any architecture which does not support 64 bit ints can hack their way around this or simply truncate the data and accept that they can't read big files.

This would leave ambiguity for most user objects, which tend to specify things like "int", and don't really care if an int is bigger than 32 bits or not. That's OK. Only objects which care about consistant access to large integers, etc, should use these types.