Next: , Previous: Endianness, Up: System Information


15.2 Register Width

— Function: unsigned short get_register_width (void)

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().

— Function: bool is_32_bit (void)

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

— Function: bool is_64_bit (void)

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