diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-11-27 08:02:35 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-11-27 08:02:35 +0000 |
commit | 2b8b47818cbb3c4bb890eb720fdb914578831f39 (patch) | |
tree | 4b86d84c82b0f28be0ac53548df68f301cf39ee0 /regcomp.h | |
parent | 55eed6530071fdede680c5313b36f33946ae9956 (diff) | |
download | perl-2b8b47818cbb3c4bb890eb720fdb914578831f39.tar.gz |
Move words and revcharmap out of struct _rev_trie_data and duplicate
them on thread clone.
p4raw-id: //depot/perl@29394
Diffstat (limited to 'regcomp.h')
-rw-r--r-- | regcomp.h | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -430,6 +430,7 @@ END_EXTERN_C * in the character class * t - trie struct * u - trie struct's widecharmap (a HV, so can't share, must dup) + * also used for revcharmap and words under DEBUGGING * T - aho-trie struct * S - sv for named capture lookup * 20010712 mjd@plover.com @@ -537,10 +538,20 @@ struct _reg_trie_data { U32 wordcount; /* Build only */ #ifdef DEBUGGING STRLEN charcount; /* Build only */ - AV *words; /* Array of words contained in trie, for dumping */ - AV *revcharmap; /* Map of each charid back to its character representation */ #endif }; +/* There is one (3 under DEBUGGING) pointers that logically belong in this + structure, but are held outside as they need duplication on thread cloning, + whereas the rest of the structure can be read only: + HV *widecharmap; code points > 255 to charid +#ifdef DEBUGGING + AV *words; Array of words contained in trie, for dumping + AV *revcharmap; Map of each charid back to its character representation +#endif +*/ + +#define TRIE_WORDS_OFFSET 2 + typedef struct _reg_trie_data reg_trie_data; /* refcount is first in both this and _reg_trie_data to allow a space @@ -577,10 +588,8 @@ typedef struct _reg_ac_data reg_ac_data; #ifdef DEBUGGING #define TRIE_CHARCOUNT(trie) ((trie)->charcount) -#define TRIE_REVCHARMAP(trie) ((trie)->revcharmap) #else #define TRIE_CHARCOUNT(trie) (trie_charcount) -#define TRIE_REVCHARMAP(trie) (trie_revcharmap) #endif #define RE_TRIE_MAXBUF_INIT 65536 |