diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-08-03 11:24:26 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-08-03 11:24:26 (GMT) |
commit | 4d179bc994cf85832d08f468c7e4122ad23e9244 (patch) | |
tree | 3348d3c001c961e9e464a644c12c9fc85e78d9b5 /src/arch/instruction.h | |
parent | 77735c8c77497498e3beb4f5bcec7de3b592fcbd (diff) |
Updated the reference counters when providing instruction links.
Diffstat (limited to 'src/arch/instruction.h')
-rw-r--r-- | src/arch/instruction.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/arch/instruction.h b/src/arch/instruction.h index aadd2fc..34dc59f 100644 --- a/src/arch/instruction.h +++ b/src/arch/instruction.h @@ -211,6 +211,10 @@ typedef struct _instr_link_t } instr_link_t; +#define ref_instr_link(l) g_object_ref(G_OBJECT(l->linked)); +#define unref_instr_link(l) g_object_unref(G_OBJECT(l->linked)); + + /* Met à disposition un encadrement des accès aux liens. */ void g_arch_instruction_lock_unlock_links(GArchInstruction *, bool, bool); @@ -230,7 +234,7 @@ bool g_arch_instruction_change_link(GArchInstruction *, GArchInstruction *, Inst size_t g_arch_instruction_count_sources(const GArchInstruction *); /* Fournit les détails d'une origine d'une instruction donnée. */ -instr_link_t *g_arch_instruction_get_source(GArchInstruction *, size_t); +const instr_link_t *g_arch_instruction_get_source(GArchInstruction *, size_t); #define g_arch_instruction_lock_dest(ins) g_arch_instruction_lock_unlock_links(ins, false, true) #define g_arch_instruction_unlock_dest(ins) g_arch_instruction_lock_unlock_links(ins, false, false) @@ -239,7 +243,7 @@ instr_link_t *g_arch_instruction_get_source(GArchInstruction *, size_t); size_t g_arch_instruction_count_destinations(const GArchInstruction *); /* Fournit les détails d'une destination d'une instruction. */ -instr_link_t *g_arch_instruction_get_destination(GArchInstruction *, size_t); +const instr_link_t *g_arch_instruction_get_destination(GArchInstruction *, size_t); /* Fournit la destination d'une instruction et d'un type donné. */ GArchInstruction *g_arch_instruction_get_given_destination(GArchInstruction *, InstructionLinkType); |