[java-atk-wrapper/objectTable_debug] Debug objecttable
- From: Samuel Thibault <sthibaul src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [java-atk-wrapper/objectTable_debug] Debug objecttable
- Date: Thu, 20 Jun 2019 19:49:37 +0000 (UTC)
commit 62b8a2ff2c23bb9393bc4c96936358fd4254eca6
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date: Thu Jun 20 21:49:08 2019 +0200
Debug objecttable
jni/src/jawimpl.c | 14 ++++++++++++++
jni/src/jawimpl.h | 1 +
2 files changed, 15 insertions(+)
---
diff --git a/jni/src/jawimpl.c b/jni/src/jawimpl.c
index 9f987c3..07059f7 100644
--- a/jni/src/jawimpl.c
+++ b/jni/src/jawimpl.c
@@ -100,6 +100,8 @@ object_table_gc(JNIEnv *jniEnv)
gpointer key, value;
GSList *list = NULL, *cur, *next;
+ unsigned count[2*INTERFACE_VALUE] = { 0, };
+
g_mutex_lock(&objectTableMutex);
if (objectTable)
{
@@ -112,10 +114,21 @@ object_table_gc(JNIEnv *jniEnv)
/* Got garbage-collected, mark for dropping */
list = g_slist_prepend(list, jaw_impl);
}
+ else
+ {
+ count[jaw_impl->tflag]++;
+ }
}
}
g_mutex_unlock(&objectTableMutex);
+ unsigned i;
+ for (i = 0; i < 2*INTERFACE_VALUE; i++) {
+ if (count[i] != 0) {
+ fprintf(stderr,"%x: %d\n", i, count[i]);
+ }
+ }
+
for (cur = list; cur != NULL; cur = next)
{
JawImpl *jaw_impl = cur->data;
@@ -141,6 +154,7 @@ static void
aggregate_interface(JNIEnv *jniEnv, JawObject *jaw_obj, guint tflag)
{
JawImpl *jaw_impl = JAW_IMPL(tflag, jaw_obj);
+ jaw_impl->tflag = tflag;
jobject ac = (*jniEnv)->NewGlobalRef(jniEnv, jaw_obj->acc_context);
jaw_impl->ifaceTable = g_hash_table_new(NULL, NULL);
diff --git a/jni/src/jawimpl.h b/jni/src/jawimpl.h
index f35bb1b..2c47bf8 100644
--- a/jni/src/jawimpl.h
+++ b/jni/src/jawimpl.h
@@ -48,6 +48,7 @@ struct _JawImpl
GHashTable *ifaceTable;
gint hash_key;
+ unsigned tflag;
};
JawImpl* jaw_impl_get_instance(JNIEnv*, jobject);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]