summaryrefslogtreecommitdiff
path: root/src/format/symbol.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2020-04-09 20:23:33 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2020-04-09 20:23:33 (GMT)
commitee138199fe0d7bcc114cfb7001e968c4738a8ce5 (patch)
treef8fd344c7b9eb4227305c1af746fd5b4794fa179 /src/format/symbol.c
parent7ce6a7f670b83e1c51c87c0e421037c849df85c2 (diff)
Compressed the size of the symbol structures.
Diffstat (limited to 'src/format/symbol.c')
-rw-r--r--src/format/symbol.c48
1 files changed, 44 insertions, 4 deletions
diff --git a/src/format/symbol.c b/src/format/symbol.c
index 30987ae..c10c46d 100644
--- a/src/format/symbol.c
+++ b/src/format/symbol.c
@@ -123,6 +123,8 @@ static void g_binary_symbol_class_init(GBinSymbolClass *klass)
static void g_binary_symbol_init(GBinSymbol *symbol)
{
+ INIT_BIN_SYMBOL_EXTRA(symbol);
+
g_binary_symbol_set_stype(symbol, STP_COUNT);
g_binary_symbol_set_status(symbol, SSS_INTERNAL);
@@ -328,7 +330,15 @@ const mrange_t *g_binary_symbol_get_range(const GBinSymbol *symbol)
void g_binary_symbol_set_stype(GBinSymbol *symbol, SymbolType type)
{
- symbol->stype = type;
+ sym_obj_extra *extra; /* Données insérées à modifier */
+
+ extra = GET_BIN_SYMBOL_EXTRA(symbol);
+
+ g_bit_lock(&extra->lock, HOLE_LOCK_BIT);
+
+ extra->stype = type;
+
+ g_bit_unlock(&extra->lock, HOLE_LOCK_BIT);
}
@@ -347,7 +357,18 @@ void g_binary_symbol_set_stype(GBinSymbol *symbol, SymbolType type)
SymbolType g_binary_symbol_get_stype(const GBinSymbol *symbol)
{
- return symbol->stype;
+ SymbolType result; /* Type à retourner */
+ sym_obj_extra *extra; /* Données insérées à modifier */
+
+ extra = GET_BIN_SYMBOL_EXTRA(symbol);
+
+ g_bit_lock(&extra->lock, HOLE_LOCK_BIT);
+
+ result = extra->stype;
+
+ g_bit_unlock(&extra->lock, HOLE_LOCK_BIT);
+
+ return result;
}
@@ -367,7 +388,15 @@ SymbolType g_binary_symbol_get_stype(const GBinSymbol *symbol)
void g_binary_symbol_set_status(GBinSymbol *symbol, SymbolStatus status)
{
- symbol->status = status;
+ sym_obj_extra *extra; /* Données insérées à modifier */
+
+ extra = GET_BIN_SYMBOL_EXTRA(symbol);
+
+ g_bit_lock(&extra->lock, HOLE_LOCK_BIT);
+
+ extra->status = status;
+
+ g_bit_unlock(&extra->lock, HOLE_LOCK_BIT);
}
@@ -386,7 +415,18 @@ void g_binary_symbol_set_status(GBinSymbol *symbol, SymbolStatus status)
SymbolStatus g_binary_symbol_get_status(const GBinSymbol *symbol)
{
- return symbol->status;
+ SymbolStatus result; /* Visibilité à retourner */
+ sym_obj_extra *extra; /* Données insérées à modifier */
+
+ extra = GET_BIN_SYMBOL_EXTRA(symbol);
+
+ g_bit_lock(&extra->lock, HOLE_LOCK_BIT);
+
+ result = extra->status;
+
+ g_bit_unlock(&extra->lock, HOLE_LOCK_BIT);
+
+ return result;
}