Node:Register Width, Next:, Previous:Endianness, Up:System Information



Register Width

unsigned short get_register_width (void) Function
Returns the register width of the CPU of the system on which 3DLDF is being run. This will normally be either 32 or 64 bits.

This is the C++ code:

          return (sizeof(void*) * CHAR_BIT);
          

This assumes that an address will be the same size as the processor's registers, and that CHAR_BIT will be the number of bits in a byte. These are reasonable assumptions that apply to all architectures I know about.

This function is called by is_32_bit() and is_64_bit().

bool is_32_bit (void) Function
Returns true if the CPU of the system on which 3DLDF is being run has a register width of 32 bits, otherwise false.

bool is_64_bit (void) Function
Returns true if the CPU of the system on which 3DLDF is being run has a register width of 64 bits, otherwise false.