diff options
author | Yves Orton <demerphq@gmail.com> | 2013-11-24 16:24:16 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2013-11-24 17:57:49 +0100 |
commit | 09a658380cac4441d8d6c85dc27e49879bf5af26 (patch) | |
tree | 80daf857f81e4bc1c062e924e9fd784fed9586f2 /regcomp.h | |
parent | 1d330354a1a1ceca70309508edd42abe0d141adc (diff) | |
download | perl-09a658380cac4441d8d6c85dc27e49879bf5af26.tar.gz |
Avoid pointer churn in study_chunk recursion bitmap allocation
Since we can only recurse into a given paren (or the entire pattern)
once, we know that the maximum recursion depth is the number of parens
in the pattern (plus one for "whole pattern"). This means we can
preallocate one large bitmap, and then use different chunks of it
for each level. That avoids SAVEFREEPV costs for each bitmap, which
are likely short anyway. (One could imagine an optimization where a
flag somewhere lets us use the RExC_study_chunk_recursed pointer
as a bitmap, so we dont have to allocate all when we have less than
32 parens.)
This removes the "recursed" argument from study_chunk() and replaces
it with a "recursive_depth" argument which counts how deep we
are in the bitmap "stack".
Diffstat (limited to 'regcomp.h')
-rw-r--r-- | regcomp.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -527,6 +527,7 @@ struct regnode_ssc { #define REG_SEEN_CUTGROUP 0x00000100 #define REG_SEEN_RUN_ON_COMMENT 0x00000200 #define REG_SEEN_EXACTF_SHARP_S 0x00000400 +#define REG_SEEN_GOSTART 0x00000800 START_EXTERN_C |