I looked inside the header file <stdint.h>
on my implementation. I see the following:
typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
I have a 64-bit system, so a long int occupies 64 bits. Why are all three data types typedefed as being long ints? I understand the case of the int_fast64_t, which is 64 bits. But why are the 16 and 32-bit data types having 64 bits? Is this some kind of error? I created a small program to check if this is the case:
sizeof(int_fast8_t) : 1
sizeof(int_fast16_t) : 8
sizeof(int_fast32_t) : 8
sizeof(int_fast64_t) : 8
Are the sizes of these data types implementation defined? What features or characteristics defines a data type as being "fast"? Is it the speed that chunks of data get loaded from the RAM to the CPU? If int_fast16_t
and int_fast32_t
are 8 bytes wide, what are the benefits in performance? Is it really faster to access a 64-bit data type on a 64-bit system?