Porting native code from 31-bit to 64-bit systems
If your Java™ application uses native code, you must first ensure that the native code continues to work correctly when it is ported to the 64-bit environment. You must also make appropriate changes to ensure that the native code works with the 64-bit versions of the JNI and JVMTI.
Consult the documentation relating to your operating system and to your C/C++ compiler for changes that are needed to port code from 32 bit to 64 bit.
You must also make sure that data types are correctly aligned. Incorrect alignment can cause serious loss of code performance. The correct alignment for various data types is shown in the following table:
C/C++ data type | Alignment on 31-bit z/OS operating systems | Alignment on 64-bit z/OS operating systems |
---|---|---|
char | 1/1 | 1/1 |
short | 2/2 | 2/2 |
int | 4/4 | 4/4 |
long | 4/4 | 8/8 |
long long | 8/8 | 8/8 |
pointer | 4/4 | 8/8 |
float | 4/4 | 4/4 |
double | 8/4 | 8/4 |
long double | 16/16 | 16/16 |
When the native code has been adjusted to take account of the differences between 31-bit systems and 64-bit systems, tune the code to accommodate differences in the interfaces to the Java VM: the JNI and the JVMTI.