__huge

The __huge keyword specifies that a name is to have 32-bit addressing. For objects, this 32-bit address contains the segment and offset of the object; for functions, it is illegal.

The default naming convention for objects specified as __huge is source-filename_DATA. (This is identical to the naming convention described for objects declared as __far.)

Class-type objects declared as __huge have:

Far addressing for member data.

Far this pointer.

Function calling determined by the compilation options.

Relaxed limit on object and array size. Objects and arrays can be greater than 64K in size; however, if an array exceeds 128K bytes in size, the individual elements must be of a length that is a power of two.

Objects declared as __huge trade efficiency in pointer arithmetic for relaxed limits on array and object size.

Declaring an object of automatic storage class as __huge generates an error. Only static arrays and memory allocated using the new operator can be declared as huge, as in the following example:

struct Customer

{

char szName[40]; // An object of type Customer

char szAddr1[30]; // requires 149 bytes of

char szAddr2[30]; // memory.

char szCity[30];

char szZip[9];

char szPhone[10];

};

int main()

{

// Allocate a static array that occupies 447,000 bytes.

static Customer __huge GiantArray[3000];

// Allocate a dynamic array that occupies 447,000 bytes.

Customer __huge *pCustList = new Customer[3000];

Customer __huge GiantAutoArray[3000]; // Error. Automatic.

}

Note:

Some, but not all, of the run-time library functions support huge types. Check the Run-Time Library Reference manual to see if a particular function will work with objects declared as __huge.

32-Bit Specific

The __huge keyword is not supported in 32-bit compilations.¨