4 Data Variables and Data handling
Memory Consumption
Use the following tables to work out the number of bytes needed in main memory for each type of variable.
Simple Variables
- Real precision
- 4 bytes + 12 bytes
- Short precision
- 4 bytes + 12 bytes
- Integer precision
- 4 bytes + 4 bytes
- Dinteger
- 4 bytes + 4 bytes
- String
- 8 bytes + length (1 byte per character, rounded up to a 4 byte boundary).
Array Variables
- Real precision
- 8 bytes + 8 bytes per dimension + 12 bytes per element
- Short precision
- 8 bytes + 8 bytes per dimension + 12 bytes per element
- Integer precision
- 8 bytes + 8 bytes per dimension + 4 bytes per element
- Dinteger
- 8 bytes + 8 bytes per dimension + 4 bytes per element
- String
- 12 bytes + 8 bytes per dimension + 4 bytes per element + length of each string (1 byte per character, rounded up to a 4 byte boundary).
The rightmost number shows the space needed in memory for the value; the preceding numbers show the overhead required for the variable description. (This is information on the type of variable and subscript information for arrays.) For example, one REAL variable takes 4 bytes for the variable description and 12 bytes for the full precision number--16 bytes in all.
Control Byte Overhead
Control bytes are automatically added to each end of a string containing display-enhanced characters or characters from an alternate set (for example, line drawing or underlining characters).
In general, one byte is added to each end of the string for each alternate character set used. So a string of blinking, inverse-video, line-drawing characters requires four additional bytes of memory--two for setting and resetting the enhancement mode and two for setting and resetting the line-drawing set.
Eloquence Language Manual - 19 DEC 2002