From 9e5dba8d520cca718209d93fb89a4c5daebb7655 Mon Sep 17 00:00:00 2001 From: cnstar9988 Date: Fri, 20 Nov 2020 18:16:56 +0800 Subject: [PATCH] force sigar_set_pointer use 64bit pointer fix https://github.com/hyperic/sigar/issues/141, https://github.com/hyperic/sigar/issues/138 --- bindings/java/src/jni/javasigar.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/bindings/java/src/jni/javasigar.c b/bindings/java/src/jni/javasigar.c index c75c9ff09..4bcdcefeb 100644 --- a/bindings/java/src/jni/javasigar.c +++ b/bindings/java/src/jni/javasigar.c @@ -187,13 +187,8 @@ static void *sigar_get_pointer(JNIEnv *env, jobject obj) { jfieldID pointer_field; jclass cls = JENV->GetObjectClass(env, obj); -#ifdef SIGAR_POINTER_LONG pointer_field = JENV->GetFieldID(env, cls, "longSigarWrapper", "J"); return (void *)JENV->GetLongField(env, obj, pointer_field); -#else - pointer_field = JENV->GetFieldID(env, cls, "sigarWrapper", "I"); - return (void *)JENV->GetIntField(env, obj, pointer_field); -#endif } static jni_sigar_t *sigar_get_jpointer(JNIEnv *env, jobject obj) { @@ -218,13 +213,8 @@ static void sigar_set_pointer(JNIEnv *env, jobject obj, const void *ptr) { jfieldID pointer_field; jclass cls = JENV->GetObjectClass(env, obj); -#ifdef SIGAR_POINTER_LONG pointer_field = JENV->GetFieldID(env, cls, "longSigarWrapper", "J"); JENV->SetLongField(env, obj, pointer_field, (jlong)ptr); -#else - pointer_field = JENV->GetFieldID(env, cls, "sigarWrapper", "I"); - JENV->SetIntField(env, obj, pointer_field, (int)ptr); -#endif } /* for jni/win32 */