60
61 void JNICALL
62 VMDeath(jvmtiEnv *jvmti_env, JNIEnv *env) {
63
64 NSK_DISPLAY0("VMDeath event received\n");
65
66 if (obj_free != EXP_OBJ_FREE) {
67 NSK_COMPLAIN2(
68 "Received unexpected number of ObjectFree events: %d\n"
69 "\texpected number: %d\n",
70 obj_free, EXP_OBJ_FREE);
71 exit(95 + STATUS_FAILED);
72 }
73
74 exit(95 + PASSED);
75 }
76
77 /************************/
78
79 JNIEXPORT void JNICALL
80 Java_nsk_jvmti_scenarios_allocation_AP12_ap12t001_setTag( JNIEnv* jni, jobject obj, jlong tag) {
81
82 if (!NSK_JVMTI_VERIFY(jvmti->SetTag(obj, tag))) {
83 nsk_jvmti_setFailStatus();
84 }
85 }
86
87 static void JNICALL
88 agentProc(jvmtiEnv* jvmti, JNIEnv* jni, void* arg) {
89
90 jclass debugeeClass = NULL;
91
92 NSK_DISPLAY0("Wait for debugee start\n\n");
93 if (!NSK_VERIFY(nsk_jvmti_waitForSync(timeout)))
94 return;
95
96 NSK_DISPLAY0("Let debugee to provoke GC\n");
97 if (!NSK_VERIFY(nsk_jvmti_resumeSync()))
98 return;
99 if (!NSK_VERIFY(nsk_jvmti_waitForSync(timeout)))
100 return;
|
60
61 void JNICALL
62 VMDeath(jvmtiEnv *jvmti_env, JNIEnv *env) {
63
64 NSK_DISPLAY0("VMDeath event received\n");
65
66 if (obj_free != EXP_OBJ_FREE) {
67 NSK_COMPLAIN2(
68 "Received unexpected number of ObjectFree events: %d\n"
69 "\texpected number: %d\n",
70 obj_free, EXP_OBJ_FREE);
71 exit(95 + STATUS_FAILED);
72 }
73
74 exit(95 + PASSED);
75 }
76
77 /************************/
78
79 JNIEXPORT void JNICALL
80 Java_nsk_jvmti_scenarios_allocation_AP12_ap12t001_setTag(JNIEnv* jni, jobject obj, jlong tag) {
81
82 if (!NSK_JVMTI_VERIFY(jvmti->SetTag(obj, tag))) {
83 nsk_jvmti_setFailStatus();
84 }
85 }
86
87 static void JNICALL
88 agentProc(jvmtiEnv* jvmti, JNIEnv* jni, void* arg) {
89
90 jclass debugeeClass = NULL;
91
92 NSK_DISPLAY0("Wait for debugee start\n\n");
93 if (!NSK_VERIFY(nsk_jvmti_waitForSync(timeout)))
94 return;
95
96 NSK_DISPLAY0("Let debugee to provoke GC\n");
97 if (!NSK_VERIFY(nsk_jvmti_resumeSync()))
98 return;
99 if (!NSK_VERIFY(nsk_jvmti_waitForSync(timeout)))
100 return;
|