diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/tsearch/dicts/spell.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/include/tsearch/dicts/spell.h b/src/include/tsearch/dicts/spell.h index 9847e30208c..e03ed423721 100644 --- a/src/include/tsearch/dicts/spell.h +++ b/src/include/tsearch/dicts/spell.h @@ -82,6 +82,17 @@ typedef struct spell_struct #define SPELLHDRSZ (offsetof(SPELL, word)) /* + * If an affix uses a regex, we have to store that separately in a struct + * that won't move around when arrays of affixes are enlarged or sorted. + * This is so that it can be found to be cleaned up at context destruction. + */ +typedef struct aff_regex_struct +{ + regex_t regex; + MemoryContextCallback mcallback; +} aff_regex_struct; + +/* * Represents an entry in an affix list. */ typedef struct aff_struct @@ -97,7 +108,7 @@ typedef struct aff_struct char *repl; union { - regex_t regex; + aff_regex_struct *pregex; Regis regis; } reg; } AFFIX; |