Programming with Intel Extended Memory 64 Technology: Migrating Software for Optimal 64-bit Performance

As described in several chapters in this book, porting is a process that consists of searching for and correcting dozens of small details any one of which, if overlooked, can lead to sudden, difficult-to-reproduce bugs. This checklist helps make sure you've checked for the "gotchas" lurking in your code.
|
| Calls to native routines cause the biggest problem. These routines must run in 64-bit mode if the managed environment is in 64-bit mode. |
|
| Microsoft .NET byte codes for platforms with Intel EM64T do not run unchanged in 32-bit modes. Make sure to provide versions for both platforms. |
|
| Check for casts of pointers to integral types. |
|
| Notice the promotion of integers to longs includes expansion from 32 to 64 bits on Linux with Intel EM64T. No change on Windows. |
|
| Check for casts of longs to integers results in truncation of 64 to 32 bits on Linux with Intel EM64T. No change on Windows. |
|
| Check structures: the new size of fundamental types changes padding, alignment, and size of fields in a structure. |
|
| Check unions: the new size of fundamental types changes padding, alignment, and size of fields in a union. Do overlapping fields still overlap correctly? |
|
| Check routines that depend on the specific number of bits of a data object. These situations occur especially in bit-wise operations and in computing hash codes. |
|
| If you use abstracted data... |