Portability and performance

From D Wiki
Jump to: navigation, search

Portability and Performance

On code created today for 32-bit CPUs that may need to be used on 64-bit or larger CPUs in the future.

per Walter from the D forum:

For a loop index, you should use 'size_t'. This is because the offset to a pointer will increase in size on 64 bit machines. size_t is defined in object.d.

The D spec defines int as a signed 32 bit integer. size_t is "an alias for an unsigned integral type spanning the address space"