Hi! This proposed patch contains: 1. a fix for GtkToolkit.c (convert local ref to global, see bug #40889); 2. minor fix for JCL_realloc() (don't call free(ptr) if ptr is null like in JCL_free); 3. 32/64-bit code variants collapsed by introducing several macros (which select the proper class name, primitive type, etc.); 4. new recognized macro (JCL_NO_JNIONLOAD) which removes the need for JNI_OnLoad (thus, if JCL_NO_JNIONLOAD is defined, it is possible to link jcl.c statically).
Note on JCL_NO_JNIONLOAD: it roughly turns on the old Classpath implementation
of
JCL_NewRawDataObject and JCL_GetRawData which wasn't based on JNI_OnLoad(), the
difference is that the new implementation is MT-safe (unless the CPU does not
offer atomicity of pointer accesses).
ChangeLog entries:
* native/jni/classpath/jcl.c (JCL_POINTER_CLASSNAME,
JCL_POINTER_DATASIGN, JCL_POINTER_INTTYPE, JCL_POINTER_GETFIELD): New
macro (used only in JNI_OnLoad, JCL_NewRawDataObject, JCL_GetRawData).
* native/jni/classpath/jcl.c (JCL_NO_JNIONLOAD): Recognize new macro.
* native/jni/classpath/jcl.c (JNI_OnLoad): Define only if not
JCL_NO_JNIONLOAD.
* native/jni/classpath/jcl.c (JNI_OnLoad, JCL_NewRawDataObject): Use
JCL_POINTER_xxx macros instead of SIZEOF_VOID_P.
* native/jni/classpath/jcl.c (JCL_realloc): Don't call free() for
NULL pointer.
* native/jni/classpath/jcl.c (JCL_NewRawDataObject, JCL_GetRawData):
Initialize rawDataClass, rawData_fid, rawData_mid global variables
if JCL_NO_JNIONLOAD.
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c
(Java_gnu_java_awt_peer_gtk_GtkToolkit_gtkInit): Convert gtktoolkit
value to a global reference (to be accessible in set_running_flag,
clear_running_flag).
Bye.
classpath-ivmai-03.diff
Description: Binary data
