summaryrefslogtreecommitdiff
path: root/src/arch/jvm
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2014-07-31 05:53:06 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2014-07-31 05:53:06 (GMT)
commita5d8e3fc30cda2e13d30f099e93ab1b182fdc0bd (patch)
treecf183906b2301cd3c726af820292fd0f2458bfa1 /src/arch/jvm
parentdc436357ff29158dddd836d368d152d42d5b086b (diff)
Improved the way code is decoded by avoiding to propagate the base address everywhere.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@385 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/jvm')
-rw-r--r--src/arch/jvm/processor.c55
1 files changed, 54 insertions, 1 deletions
diff --git a/src/arch/jvm/processor.c b/src/arch/jvm/processor.c
index 10efc5b..5872fd9 100644
--- a/src/arch/jvm/processor.c
+++ b/src/arch/jvm/processor.c
@@ -52,6 +52,12 @@ static void g_jvm_processor_class_init(GJvmProcessorClass *);
/* Initialise une instance de processeur de JVM. */
static void g_jvm_processor_init(GJvmProcessor *);
+/* Supprime toutes les références externes. */
+static void g_jvm_processor_dispose(GJvmProcessor *);
+
+/* Procède à la libération totale de la mémoire. */
+static void g_jvm_processor_finalize(GJvmProcessor *);
+
/* Décode une instruction dans un flux de données. */
static GArchInstruction *g_jvm_processor_decode_instruction(const GJvmProcessor *, const bin_t *, off_t *, off_t, vmpa_t);
@@ -75,6 +81,17 @@ G_DEFINE_TYPE(GJvmProcessor, g_jvm_processor, G_TYPE_ARCH_PROCESSOR);
static void g_jvm_processor_class_init(GJvmProcessorClass *klass)
{
+ GObjectClass *object; /* Autre version de la classe */
+ GArchProcessorClass *proc; /* Encore une autre vision... */
+
+ object = G_OBJECT_CLASS(klass);
+
+ object->dispose = (GObjectFinalizeFunc/* ! */)g_jvm_processor_dispose;
+ object->finalize = (GObjectFinalizeFunc)g_jvm_processor_finalize;
+
+ proc = G_ARCH_PROCESSOR_CLASS(klass);
+
+ proc->decode = (decode_instruction_fc)g_jvm_processor_decode_instruction;
}
@@ -100,7 +117,43 @@ static void g_jvm_processor_init(GJvmProcessor *proc)
parent->endianness = SRE_BIG;
parent->memsize = MDS_32_BITS;
- parent->decode = (decode_instruction_fc)g_jvm_processor_decode_instruction;
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : proc = instance d'objet GLib à traiter. *
+* *
+* Description : Supprime toutes les références externes. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_jvm_processor_dispose(GJvmProcessor *proc)
+{
+ G_OBJECT_CLASS(g_jvm_processor_parent_class)->dispose(G_OBJECT(proc));
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : bookmark = instance d'objet GLib à traiter. *
+* *
+* Description : Procède à la libération totale de la mémoire. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_jvm_processor_finalize(GJvmProcessor *proc)
+{
+ G_OBJECT_CLASS(g_jvm_processor_parent_class)->finalize(G_OBJECT(proc));
}