Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use jxbt_get_jfield instead of jxbt_get_sfield (faster)
[simgrid.git] / src / jmsg_host.c
index da4426b..c01a132 100644 (file)
@@ -57,7 +57,7 @@ Java_org_simgrid_msg_Host_nativeInit(JNIEnv *env, jclass cls) {
        jclass class_Host = (*env)->FindClass(env, "org/simgrid/msg/Host");
        jhost_method_Host_constructor = (*env)->GetMethodID(env, class_Host, "<init>", "()V");
        //FIXME: Don't use jxbt_get_sfield directly, it is slower.
        jclass class_Host = (*env)->FindClass(env, "org/simgrid/msg/Host");
        jhost_method_Host_constructor = (*env)->GetMethodID(env, class_Host, "<init>", "()V");
        //FIXME: Don't use jxbt_get_sfield directly, it is slower.
-       jhost_field_Host_bind = jxbt_get_sfield(env,"org/simgrid/msg/Host", "bind", "J");
+       jhost_field_Host_bind = jxbt_get_jfield(env,class_Host, "bind", "J");
        jhost_field_Host_name = jxbt_get_jfield(env, class_Host, "name", "Ljava/lang/String;");
        if (!class_Host || !jhost_field_Host_name || !jhost_method_Host_constructor || !jhost_field_Host_bind) {
        jxbt_throw_native(env,bprintf("Can't find some fields in Java class. You should report this bug."));
        jhost_field_Host_name = jxbt_get_jfield(env, class_Host, "name", "Ljava/lang/String;");
        if (!class_Host || !jhost_field_Host_name || !jhost_method_Host_constructor || !jhost_field_Host_bind) {
        jxbt_throw_native(env,bprintf("Can't find some fields in Java class. You should report this bug."));