Sun Studio 12: C User's Guide

F.1 Storage Allocation

The following table shows the data types and how they are represented.


Note –

Storage allocated on the stack (identifiers with internal, or automatic, linkage) should be limited to two gigabytes or less.


Table F–1 Storage Allocation for Data Types

Data Type  

Internal Representation  

char elements

A single 8-bit byte aligned on a byte boundary. 

short integers

Halfword (two bytes or 16 bits), aligned on a two-byte boundary 

int

32 bits (four bytes or one word), aligned on a four-byte boundary 

long

32 bits on v8 and x86 (four bytes or one word), aligned on a four-byte boundary 

64 bits on v9 (eight bytes or two words) aligned on an eight-byte boundary) 

pointer

32 bits on v8 and x86 (four bytes or one word), aligned on a four-byte boundary 

64 bits on v9 (eight bytes or two words) aligned on an eight-byte boundary) 

long long [long long is not available in -Xc mode with -xc99=none.]

(SPARC) 64 bits (eight bytes or two words), aligned on an eight-byte boundary 

(x86) 64 bits (eight bytes or two words), aligned on a four-byte boundary

float

32 bits (four bytes or one word), aligned on a four-byte boundary. A float has a sign bit, 8-bit exponent, and 23-bit fraction.

double

64 bits (eight bytes or two words), aligned on an eight-byte boundary (SPARC) or aligned on a four-byte boundary (x86). A double element has a sign bit, an 11-bit exponent and a 52-bit fraction.

long double

v8 (SPARC) 128 bits (16 bytes or four words), aligned on an eight-byte boundary. A long double element has a sign bit, a 15-bit exponent and a 112-bit fraction.

v9 (SPARC) 128 bits (16 bytes or four words), aligned on a 16 byte boundary. A long double element has a sign bit, a 15-bit exponent and a 112-bit fraction.

(x86) 96 bits (12 bytes or three words) aligned on a four-byte boundary. A long double element has a sign bit, a 16-bit exponent, and a 64-bit fraction. 16 bits are unused.