diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2024-03-04 08:11:19 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2024-03-04 08:11:19 (GMT) |
commit | fad3328dbabccc33e984f2f9a39411e959dc03e1 (patch) | |
tree | 810175d04bacc667bc19032e929ffbe84436d136 /src/analysis/scan/exprs/setcounter-int.h | |
parent | 7f25bd904e483ca90548c7001839a102090eb290 (diff) |
Share instances to avoid extra calls to g_object_[un]ref().
Diffstat (limited to 'src/analysis/scan/exprs/setcounter-int.h')
-rw-r--r-- | src/analysis/scan/exprs/setcounter-int.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/analysis/scan/exprs/setcounter-int.h b/src/analysis/scan/exprs/setcounter-int.h index fbed209..c9e3da5 100644 --- a/src/analysis/scan/exprs/setcounter-int.h +++ b/src/analysis/scan/exprs/setcounter-int.h @@ -37,8 +37,13 @@ struct _GScanSetMatchCounter { GScanExpression parent; /* A laisser en premier */ - GSearchPattern **patterns; /* Motifs associés */ + union + { + const GSearchPattern **patterns; /* Motifs associés */ + GSearchPattern **ref_patterns; /* Motifs associés */ + }; size_t count; /* Nombre de ces motifs */ + bool shared; /* Définition de propriété */ ScanSetCounterType type; /* Type de décompte */ size_t number; /* Eventuel volume associé */ @@ -53,9 +58,11 @@ struct _GScanSetMatchCounterClass }; +/* Met en place un décompte de motifs avec correspondances. */ +bool g_scan_set_match_counter_create_shared(GScanSetMatchCounter *, const GSearchPattern ** const, size_t); /* Met en place un décompte de motifs avec correspondances. */ -bool g_scan_set_match_counter_create(GScanSetMatchCounter *, GSearchPattern ** const, size_t); +bool g_scan_set_match_counter_create_and_ref(GScanSetMatchCounter *, GSearchPattern ** const, size_t); |