Commit 8fb9bd74 authored by Lubomir Bulej's avatar Lubomir Bulej

dislreagent, REDispatch: added support for sending object size from the agent.

parent 4901ee5d
......@@ -1285,6 +1285,14 @@ JNIEXPORT void JNICALL Java_ch_usi_dag_dislre_REDispatch_sendObjectPlusData
JNIEXPORT void JNICALL Java_ch_usi_dag_dislre_REDispatch_sendObjectSize
(JNIEnv * jni_env, jclass this_class, jobject to_send) {
jlong size = -1;
jvmtiError error = (*jvmti_env)->GetObjectSize(jvmti_env, to_send, &size);
check_jvmti_error(jvmti_env, error, "Cannot get object size");
pack_long(tld_get()->analysis_buff, size);
static JNINativeMethod redispatchMethods[] = {
{"registerMethod", "(Ljava/lang/String;)S", (void *)&Java_ch_usi_dag_dislre_REDispatch_registerMethod},
......@@ -1301,6 +1309,7 @@ static JNINativeMethod redispatchMethods[] = {
{"sendDouble", "(D)V", (void *)&Java_ch_usi_dag_dislre_REDispatch_sendDouble},
{"sendObject", "(Ljava/lang/Object;)V", (void *)&Java_ch_usi_dag_dislre_REDispatch_sendObject},
{"sendObjectPlusData", "(Ljava/lang/Object;)V", (void *)&Java_ch_usi_dag_dislre_REDispatch_sendObjectPlusData},
{"sendObjectSize", "(Ljava/lang/Object;)V", (void *)&Java_ch_usi_dag_dislre_REDispatch_sendObjectSize},
// ******************* CLASS LOAD callback *******************
......@@ -42,6 +42,7 @@ public class REDispatch {
public static native void sendLong(long longToSend);
public static native void sendObject(Object objToSend);
public static native void sendObjectPlusData(Object objToSend);
public static native void sendObjectSize(Object objToSend);
// Methods use similar logic as Float.floatToIntBits() and
// Double.doubleToLongBits() but implemented in the native code
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment