PRB: C Has a Default Threshold of 32,767 Bytes

ID Number: Q59255

5.10 6.00 6.00a 6.00ax 7.00 | 5.10 6.00 6.00a

MS-DOS | OS/2

Summary:

SYMPTOMS

The Microsoft C Compiler versions 5.1, 6.0, 6.0a, 6.0ax, and C/C++

version 7.0 have a default data threshold value of 32,767 bytes. The

size of your static array is probably close to that of the default

data threshold and when you add another element, it puts you over the

limit. In that case, your data is moved to a far data segment, thus

causing the speed hit on your program.

RESOLUTION

To work around this problem, you could set /Gt to a value greater

than the size of your static array, or you could explicitly declare

the array as being near.

More Information:

For more information on the /Gt switch, refer to the "Microsoft C

Optimizing Compiler User's Guide."

Additional reference words: 5.10 6.00 6.00a 6.00ax 7.00