* tests/gc/ClassInit.java: Added testcase (static initializer calling gc).
[cacao.git] / tests / gc / native.c
1 #include <jni.h>
2 #include <stdio.h>
3
4 static jobject ref = NULL;
5
6 JNIEXPORT void JNICALL Java_NativeGlobalRef_setReference(JNIEnv *env, jclass c, jobject o)
7 {
8         printf("Native-World: setReference()\n");
9
10         //ref = o;
11         ref = (*env)->NewGlobalRef(env, o);
12
13         return;
14 }
15
16 JNIEXPORT jobject JNICALL Java_NativeGlobalRef_getReference(JNIEnv *env, jclass c)
17 {
18         printf("Native-World: getReference()\n");
19
20         return ref;
21 }