Rename ${^RE_TRIE_MAXBUFF} to ${^RE_TRIE_MAXBUF},
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Tue, 22 Mar 2005 09:21:09 +0000 (09:21 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Tue, 22 Mar 2005 09:21:09 +0000 (09:21 +0000)
and other neatification

p4raw-id: //depot/perl@24065

pod/perl592delta.pod
pod/perlvar.pod
regcomp.c
regcomp.h

index ad102b8..0d88ff7 100644 (file)
@@ -66,7 +66,7 @@ effect for the regular expression engine when running under C<use re
 =head2 Trie optimization for regexp engine
 
 The regexp engine is now able to factorize common prefixes and suffixes in
-regular expressions. A new special variable, ${^RE_TRIE_MAXBUFF}, has been
+regular expressions. A new special variable, ${^RE_TRIE_MAXBUF}, has been
 added to fine tune this optimization.
 
 =head1 Installation and Configuration Improvements
index af13c81..4923dd5 100644 (file)
@@ -934,7 +934,7 @@ numeric or symbolic values, eg C<$^D = 10> 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<re> 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
index 5bfcd70..1f7530f 100644 (file)
--- 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",
index dbf55f5..74df7ab 100644 (file)
--- 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 */