Hello, all
I'm working with some large arrays (2^27 elements), and am about to run
into memory limitations. Currently I'm using a bytecard for each
element, but in expanding my program's capabilities, I want to add a
second array of cardinal. This second cardinal needs to have a range
larger than 2^16 (65535), but I don't have enough memory for a 2^32
cardinal. Sounds like 2^24 cardinals would be appropriate...
I looked into the range-specified integers in the manual. It says:
>>>
8.2.3.3 Integer Types with Specified Size
In some situations you will need an integer type of a well-defined size.
For this purpose, GNU Pascal provides three families of signed and
unsinged integer types. The type
Integer (42)
is guaranteed to have a precision of 42 bits. In a realistic context,
you will most often give a power of two as the number of bits, and the
machine you will need it on will support variables of that size. If this
is the case, the specified precision will simultaneously be the amount
of storage needed for variables of this type.
<<<
So perhaps the 24-bit cardinal would work fine.
My questions:
1) will the compiler really allocate only 24 bits, or will it align the
array elements along 32-bit boundaries?
2) If the compiler does indeed make true 24-bit-aligned cardinals, how
much speed will I lose in memory access?
If this is an unexplored issued, please let me know, in which case I'll
attempt it and report back on how it worked.
regards,
Toby
Soil Scientist, Iowa State University