Skip to content

Commit

Permalink
Update JvmFuncs.c (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
jperedadnr authored Sep 11, 2024
1 parent 98ffe47 commit f211aaf
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/JvmFuncs.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,19 @@ JNIEXPORT jlong JNICALL Java_jdk_internal_misc_VM_getNanoTimeAdjustment(void *en
return JVM_GetNanoTimeAdjustment(env, ignored, offset_secs);
}

JNIEXPORT void JNICALL JVM_ArrayCopy(JNIEnv *env, jclass ignored, jobject src, jint src_pos, jobject dst, jint dst_pos, jint length) {
jclass systemClass = (*env)->FindClass(env, "java/lang/System");
if (systemClass != NULL && !(*env)->ExceptionCheck(env)) {
jmethodID arraycopy = (*env)->GetStaticMethodID(env, systemClass, "arraycopy", "(Ljava/lang/Object;ILjava/lang/Object;II)V");
if (arraycopy != NULL && !(*env)->ExceptionCheck(env)) {
(*env)->CallStaticVoidMethod(env, systemClass, arraycopy, src, src_pos, dst, dst_pos, length);
return;
}
}

(*env)->FatalError(env, "JVM_ArrayCopy called: Could not find System#arraycopy");
}

JNIEXPORT void JNICALL JVM_Halt(int retcode) {
exit(retcode);
}
Expand Down

0 comments on commit f211aaf

Please sign in to comment.