summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-09-26 22:29:09 +0000
committerNicholas Clark <nick@ccl4.org>2006-09-26 22:29:09 +0000
commita3c0e9caa94eb215eb66e54d6286c77ccf441f01 (patch)
tree6b3f99fb79ffb54e76b7cda0e388f65417e5c1c2
parent03363afd3c2c023b9096c021741ecc63bc0de7dd (diff)
downloadperl-a3c0e9caa94eb215eb66e54d6286c77ccf441f01.tar.gz
Make Perl_regdupe only exist for threaded perls.
p4raw-id: //depot/perl@28893
-rw-r--r--embed.fnc2
-rw-r--r--embed.h4
-rw-r--r--ext/re/re.xs16
-rw-r--r--makedef.pl1
-rw-r--r--proto.h2
-rw-r--r--regcomp.c5
-rw-r--r--thrdvar.h2
7 files changed, 27 insertions, 5 deletions
diff --git a/embed.fnc b/embed.fnc
index 5755f0633e..170023c9bd 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -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 \
diff --git a/embed.h b/embed.h
index 0ec177586e..69ab33bc53 100644
--- a/embed.h
+++ b/embed.h
@@ -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
)];
}
diff --git a/proto.h b/proto.h
index 386f4ab140..2f6045d725 100644
--- a/proto.h
+++ b/proto.h
@@ -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)
diff --git a/regcomp.c b/regcomp.c
index a959bf68b6..62e0a9105d 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -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
/*
diff --git a/thrdvar.h b/thrdvar.h
index ead327824f..d25db06784 100644
--- a/thrdvar.h
+++ b/thrdvar.h
@@ -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. */