diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-09-26 22:29:09 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-09-26 22:29:09 +0000 |
commit | a3c0e9caa94eb215eb66e54d6286c77ccf441f01 (patch) | |
tree | 6b3f99fb79ffb54e76b7cda0e388f65417e5c1c2 | |
parent | 03363afd3c2c023b9096c021741ecc63bc0de7dd (diff) | |
download | perl-a3c0e9caa94eb215eb66e54d6286c77ccf441f01.tar.gz |
Make Perl_regdupe only exist for threaded perls.
p4raw-id: //depot/perl@28893
-rw-r--r-- | embed.fnc | 2 | ||||
-rw-r--r-- | embed.h | 4 | ||||
-rw-r--r-- | ext/re/re.xs | 16 | ||||
-rw-r--r-- | makedef.pl | 1 | ||||
-rw-r--r-- | proto.h | 2 | ||||
-rw-r--r-- | regcomp.c | 5 | ||||
-rw-r--r-- | thrdvar.h | 2 |
7 files changed, 27 insertions, 5 deletions
@@ -668,7 +668,9 @@ Ap |I32 |pregexec |NN regexp* prog|NN char* stringarg \ |NN char* strend|NN char* strbeg|I32 minend \ |NN SV* screamer|U32 nosave Ap |void |pregfree |NULLOK struct regexp* r +#if defined(USE_ITHREADS) Ap |regexp*|regdupe |NN const regexp* r|NN CLONE_PARAMS* param +#endif Ap |regexp*|pregcomp |NN char* exp|NN char* xend|NN PMOP* pm Ap |char* |re_intuit_start|NN regexp* prog|NULLOK SV* sv|NN char* strpos \ |NN char* strend|U32 flags \ @@ -680,7 +680,9 @@ #define regclass_swash Perl_regclass_swash #define pregexec Perl_pregexec #define pregfree Perl_pregfree +#if defined(USE_ITHREADS) #define regdupe Perl_regdupe +#endif #define pregcomp Perl_pregcomp #define re_intuit_start Perl_re_intuit_start #define re_intuit_string Perl_re_intuit_string @@ -2877,7 +2879,9 @@ #define regclass_swash(a,b,c,d,e) Perl_regclass_swash(aTHX_ a,b,c,d,e) #define pregexec(a,b,c,d,e,f,g) Perl_pregexec(aTHX_ a,b,c,d,e,f,g) #define pregfree(a) Perl_pregfree(aTHX_ a) +#if defined(USE_ITHREADS) #define regdupe(a,b) Perl_regdupe(aTHX_ a,b) +#endif #define pregcomp(a,b,c) Perl_pregcomp(aTHX_ a,b,c) #define re_intuit_start(a,b,c,d,e,f) Perl_re_intuit_start(aTHX_ a,b,c,d,e,f) #define re_intuit_string(a) Perl_re_intuit_string(aTHX_ a) diff --git a/ext/re/re.xs b/ext/re/re.xs index 7fad14642f..3433a0fd7e 100644 --- a/ext/re/re.xs +++ b/ext/re/re.xs @@ -36,14 +36,24 @@ struct regexp_engine { struct re_scream_pos_data_s *data); SV* (*re_intuit_string) (pTHX_ regexp *prog); void (*regfree) (pTHX_ struct regexp* r); +#if defined(USE_ITHREADS) regexp* (*regdupe) (pTHX_ regexp *r, CLONE_PARAMS *param); +#endif }; struct regexp_engine engines[] = { { Perl_pregcomp, Perl_regexec_flags, Perl_re_intuit_start, - Perl_re_intuit_string, Perl_pregfree, Perl_regdupe }, + Perl_re_intuit_string, Perl_pregfree +#if defined(USE_ITHREADS) + , Perl_regdupe +#endif + }, { my_regcomp, my_regexec, my_re_intuit_start, my_re_intuit_string, - my_regfree, my_regdupe } + my_regfree +#if defined(USE_ITHREADS) + , my_regdupe +#endif + } }; #define MY_CXT_KEY "re::_guts" XS_VERSION @@ -76,7 +86,9 @@ install(pTHX_ unsigned int new_state) PL_regint_start = engines[new_state].re_intuit_start; PL_regint_string = engines[new_state].re_intuit_string; PL_regfree = engines[new_state].regfree; +#if defined(USE_ITHREADS) PL_regdupe = engines[new_state].regdupe; +#endif if (new_state & NEEDS_DEBUGGING) { PL_colorset = 0; /* Allow reinspection of ENV. */ diff --git a/makedef.pl b/makedef.pl index 57d6c75f5e..6eebcab1b5 100644 --- a/makedef.pl +++ b/makedef.pl @@ -748,6 +748,7 @@ unless ($define{'USE_ITHREADS'}) { Perl_sharedsv_thrcnt_inc Perl_sharedsv_unlock Perl_stashpv_hvname_match + Perl_regdupe )]; } @@ -1833,10 +1833,12 @@ PERL_CALLCONV I32 Perl_pregexec(pTHX_ regexp* prog, char* stringarg, char* stren __attribute__nonnull__(pTHX_6); PERL_CALLCONV void Perl_pregfree(pTHX_ struct regexp* r); +#if defined(USE_ITHREADS) PERL_CALLCONV regexp* Perl_regdupe(pTHX_ const regexp* r, CLONE_PARAMS* param) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2); +#endif PERL_CALLCONV regexp* Perl_pregcomp(pTHX_ char* exp, char* xend, PMOP* pm) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2) @@ -7677,10 +7677,10 @@ Perl_pregfree(pTHX_ struct regexp *r) See pregfree() above if you change anything here. */ +#if defined(USE_ITHREADS) regexp * Perl_regdupe(pTHX_ const regexp *r, CLONE_PARAMS *param) { -#if defined(USE_ITHREADS) dVAR; REGEXP *ret; int i, len, npar; @@ -7802,10 +7802,9 @@ Perl_regdupe(pTHX_ const regexp *r, CLONE_PARAMS *param) ptr_table_store(PL_ptr_table, r, ret); return ret; -#else return NULL; -#endif } +#endif #ifndef PERL_IN_XSUB_RE /* @@ -176,8 +176,10 @@ PERLVARI(Tregint_string,re_intuit_string_t, MEMBER_TO_FPTR(Perl_re_intuit_string PERLVARI(Tregfree, regfree_t, MEMBER_TO_FPTR(Perl_pregfree)) /* Pointer to REx free()er */ +#if defined(USE_ITHREADS) PERLVARI(Tregdupe, regdupe_t, MEMBER_TO_FPTR(Perl_regdupe)) /* Pointer to REx dupe()er */ +#endif PERLVARI(Treginterp_cnt,int, 0) /* Whether "Regexp" was interpolated. */ |