From: Rafael Garcia-Suarez Date: Tue, 22 Mar 2005 09:21:09 +0000 (+0000) Subject: Rename ${^RE_TRIE_MAXBUFF} to ${^RE_TRIE_MAXBUF}, X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0111c4fd47c4cca05ba4f96d1ff28f7e9ff79155;p=p5sagit%2Fp5-mst-13.2.git Rename ${^RE_TRIE_MAXBUFF} to ${^RE_TRIE_MAXBUF}, and other neatification p4raw-id: //depot/perl@24065 --- diff --git a/pod/perl592delta.pod b/pod/perl592delta.pod index ad102b8..0d88ff7 100644 --- a/pod/perl592delta.pod +++ b/pod/perl592delta.pod @@ -66,7 +66,7 @@ effect for the regular expression engine when running under C or C<$^D = "st">. The current value of the regex debugging flags. Set to 0 for no debug output even when the re 'debug' module is loaded. See L for details. -=item ${^RE_TRIE_MAXBUFF} +=item ${^RE_TRIE_MAXBUF} Controls how certain regex optimisations are applied and how much memory they utilize. This value by default is 65536 which corresponds to a 512kB temporary diff --git a/regcomp.c b/regcomp.c index 5bfcd70..1f7530f 100644 --- a/regcomp.c +++ b/regcomp.c @@ -866,9 +866,9 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs }); - re_trie_maxbuff=get_sv(RE_TRIE_MAXBUFF, 1); + re_trie_maxbuff = get_sv(RE_TRIE_MAXBUF_NAME, 1); if (!SvIOK(re_trie_maxbuff)) { - sv_setiv(re_trie_maxbuff, TRIE_SIMPLE_MAX_BUFF); + sv_setiv(re_trie_maxbuff, RE_TRIE_MAXBUF_INIT); } /* -- First loop and Setup -- @@ -941,8 +941,8 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs /* We now know what we are dealing with in terms of unique chars and string sizes so we can calculate how much memory a naive - representation using a flat table will take. If its over a reasonable - limit (as specified by $^RE_TRIE_MAXBUFF) we use a more memory + representation using a flat table will take. If it's over a reasonable + limit (as specified by ${^RE_TRIE_MAXBUF}) we use a more memory conservative but potentially much slower representation using an array of lists. @@ -1834,13 +1834,12 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, I32 *deltap, reg it would just call its tail, no WHILEM/CURLY needed. */ - if (DO_TRIE) { - if (!re_trie_maxbuff) { - re_trie_maxbuff=get_sv(RE_TRIE_MAXBUFF, 1); - if (!SvIOK(re_trie_maxbuff)) - sv_setiv(re_trie_maxbuff, TRIE_SIMPLE_MAX_BUFF); - - } + if (DO_TRIE) { + if (!re_trie_maxbuff) { + re_trie_maxbuff = get_sv(RE_TRIE_MAXBUF_NAME, 1); + if (!SvIOK(re_trie_maxbuff)) + sv_setiv(re_trie_maxbuff, RE_TRIE_MAXBUF_INIT); + } if ( SvIV(re_trie_maxbuff)>=0 && OP( startbranch )==BRANCH ) { regnode *cur; regnode *first = (regnode *)NULL; @@ -1902,7 +1901,6 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, I32 *deltap, reg regnode *noper = NEXTOPER( cur ); regnode *noper_next = regnext( noper ); - DEBUG_OPTIMISE_r({ regprop( mysv, cur); PerlIO_printf( Perl_debug_log, "%*s%s", diff --git a/regcomp.h b/regcomp.h index dbf55f5..74df7ab 100644 --- a/regcomp.h +++ b/regcomp.h @@ -337,7 +337,7 @@ START_EXTERN_C EXTCONST U8 PL_varies[]; #else EXTCONST U8 PL_varies[] = { - BRANCH, BACK, STAR, PLUS, CURLY, CURLYX, REF, REFF, REFFL, + BRANCH, BACK, STAR, PLUS, CURLY, CURLYX, REF, REFF, REFFL, WHILEM, CURLYM, CURLYN, BRANCHJ, IFTHEN, SUSPEND, CLUMP, 0 }; #endif @@ -369,7 +369,7 @@ typedef struct re_scream_pos_data_s /* .what is a character array with one character for each member of .data * The character describes the function of the corresponding .data item: - * f - start-class data for regstclass optimization + * f - start-class data for regstclass optimization * n - Root of op tree for (?{EVAL}) item * o - Start op for (?{EVAL}) item * p - Pad for (?{EVAL} item @@ -485,9 +485,8 @@ typedef struct _reg_trie_data reg_trie_data; #define DO_TRIE 1 #define TRIE_DEBUG 1 - -#define TRIE_SIMPLE_MAX_BUFF 65536 -#define RE_TRIE_MAXBUFF "\022E_TRIE_MAXBUFF" +#define RE_TRIE_MAXBUF_INIT 65536 +#define RE_TRIE_MAXBUF_NAME "\022E_TRIE_MAXBUF" #define RE_DEBUG_FLAGS "\022E_DEBUG_FLAGS" /* If you change these be sure to update ext/re/re.pm as well */