summaryrefslogtreecommitdiff
path: root/plugins/dalvik/operands/pool.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/dalvik/operands/pool.c')
-rw-r--r--plugins/dalvik/operands/pool.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/plugins/dalvik/operands/pool.c b/plugins/dalvik/operands/pool.c
index 89bee99..baab1f6 100644
--- a/plugins/dalvik/operands/pool.c
+++ b/plugins/dalvik/operands/pool.c
@@ -82,6 +82,14 @@ static void g_dalvik_pool_operand_print(const GDalvikPoolOperand *, GBufferLine
+/* ------------------------ CONTROLE DU VOLUME DES INSTANCES ------------------------ */
+
+
+/* Fournit l'empreinte d'un candidat à une centralisation. */
+static guint g_dalvik_pool_operand_hash(const GDalvikPoolOperand *);
+
+
+
/* --------------------- TRANSPOSITIONS VIA CACHE DES OPERANDES --------------------- */
@@ -133,6 +141,8 @@ static void g_dalvik_pool_operand_class_init(GDalvikPoolOperandClass *klass)
operand->compare = (operand_compare_fc)g_dalvik_pool_operand_compare;
operand->print = (operand_print_fc)g_dalvik_pool_operand_print;
+ operand->hash = (operand_hash_fc)g_dalvik_pool_operand_hash;
+
operand->unserialize = (unserialize_operand_fc)g_dalvik_pool_operand_unserialize;
operand->serialize = (serialize_operand_fc)g_dalvik_pool_operand_serialize;
@@ -530,6 +540,49 @@ uint32_t g_dalvik_pool_operand_get_index(const GDalvikPoolOperand *operand)
/* ---------------------------------------------------------------------------------- */
+/* CONTROLE DU VOLUME DES INSTANCES */
+/* ---------------------------------------------------------------------------------- */
+
+
+/******************************************************************************
+* *
+* Paramètres : operand = objet dont l'instance se veut unique. *
+* *
+* Description : Fournit l'empreinte d'un candidat à une centralisation. *
+* *
+* Retour : Empreinte de l'élément représenté. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static guint g_dalvik_pool_operand_hash(const GDalvikPoolOperand *operand)
+{
+ guint result; /* Valeur à retourner */
+ DalvikPoolType type; /* Type porté par l'opérande */
+ uint32_t index; /* Indice de l'élément */
+
+ result = (unsigned int)(unsigned long)operand->format;
+
+#if __SIZEOF_INT__ != __SIZEOF_LONG__
+ result ^= ((unsigned long)operand->format) >> 32;
+#endif
+
+ type = g_dalvik_pool_operand_get_pool_type(operand);
+
+ result ^= type;
+
+ index = g_dalvik_pool_operand_get_index(operand);
+
+ result ^= index;
+
+ return result;
+
+}
+
+
+
+/* ---------------------------------------------------------------------------------- */
/* TRANSPOSITIONS VIA CACHE DES OPERANDES */
/* ---------------------------------------------------------------------------------- */