From: Jarkko Hietaniemi Date: Mon, 18 Mar 2002 14:39:15 +0000 (+0000) Subject: Make regex DEBUGGING faster. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=48c6b404cfbd1c2c7ca26e9a9abd0c281bc5836f;p=p5sagit%2Fp5-mst-13.2.git Make regex DEBUGGING faster. p4raw-id: //depot/perl@15297 --- diff --git a/perl.c b/perl.c index 13df3e4..ebf5ca1 100644 --- a/perl.c +++ b/perl.c @@ -258,6 +258,11 @@ perl_construct(pTHXx) PL_fdpid = newAV(); /* for remembering popen pids by fd */ PL_modglobal = newHV(); /* pointers to per-interpreter module globals */ PL_errors = newSVpvn("",0); +#ifdef DEBUGGING + sv_setpvn(PERL_DEBUG_PAD(0), "", 0); /* For regex debugging. */ + sv_setpvn(PERL_DEBUG_PAD(1), "", 0); + sv_setpvn(PERL_DEBUG_PAD(2), "", 0); +#endif #ifdef USE_ITHREADS PL_regex_padav = newAV(); av_push(PL_regex_padav,(SV*)newAV()); /* First entry is an array of empty elements */ diff --git a/perl.h b/perl.h index f7bf179..02e3f9c 100644 --- a/perl.h +++ b/perl.h @@ -3183,7 +3183,7 @@ struct perl_debug_pad { }; #define PERL_DEBUG_PAD(i) &(PL_debug_pad.pad[i]) -#define PERL_DEBUG_PAD_ZERO(i) (sv_setpvn(PERL_DEBUG_PAD(i), "", 0), PERL_DEBUG_PAD(i)) +#define PERL_DEBUG_PAD_ZERO(i) (SvPVX(PERL_DEBUG_PAD(i))[0] = 0, SvCUR(PERL_DEBUG_PAD(i)) = 0, PERL_DEBUG_PAD(i)) /* Enable variables which are pointers to functions */ typedef void (CPERLscope(*peep_t))(pTHX_ OP* o); diff --git a/regexec.c b/regexec.c index 9264b86..00bd6ef 100644 --- a/regexec.c +++ b/regexec.c @@ -2054,12 +2054,6 @@ S_regtry(pTHX_ regexp *prog, char *startpos) New(22,PL_reg_start_tmp, PL_reg_start_tmpl, char*); } -#ifdef DEBUGGING - sv_setpvn(PERL_DEBUG_PAD(0), "", 0); - sv_setpvn(PERL_DEBUG_PAD(1), "", 0); - sv_setpvn(PERL_DEBUG_PAD(2), "", 0); -#endif - /* XXXX What this code is doing here?!!! There should be no need to do this again and again, PL_reglastparen should take care of this! --ilya*/