summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cop.h10
-rw-r--r--embed.fnc7
-rw-r--r--embed.h16
-rw-r--r--pp_ctl.c8
-rw-r--r--proto.h6
5 files changed, 31 insertions, 16 deletions
diff --git a/cop.h b/cop.h
index dae356d6a0..39a6b01484 100644
--- a/cop.h
+++ b/cop.h
@@ -610,7 +610,8 @@ struct subst {
#define sb_rxres cx_u.cx_subst.sbu_rxres
#define sb_rx cx_u.cx_subst.sbu_rx
-#define PUSHSUBST(cx) CXINC, cx = &cxstack[cxstack_ix], \
+#ifdef PERL_CORE
+# define PUSHSUBST(cx) CXINC, cx = &cxstack[cxstack_ix], \
cx->sb_iters = iters, \
cx->sb_maxiters = maxiters, \
cx->sb_rflags = r_flags, \
@@ -628,11 +629,12 @@ struct subst {
rxres_save(&cx->sb_rxres, rx); \
(void)ReREFCNT_inc(rx)
-#define CxONCE(cx) ((cx)->cx_type & CXp_ONCE)
-
-#define POPSUBST(cx) cx = &cxstack[cxstack_ix--]; \
+# define POPSUBST(cx) cx = &cxstack[cxstack_ix--]; \
rxres_free(&cx->sb_rxres); \
ReREFCNT_dec(cx->sb_rx)
+#endif
+
+#define CxONCE(cx) ((cx)->cx_type & CXp_ONCE)
struct context {
union {
diff --git a/embed.fnc b/embed.fnc
index e0b84c2108..1b3fde0ff1 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -772,8 +772,11 @@ Ap |Sighandler_t|rsignal |int i|Sighandler_t t
p |int |rsignal_restore|int i|NULLOK Sigsave_t* t
p |int |rsignal_save |int i|Sighandler_t t1|NN Sigsave_t* save
Ap |Sighandler_t|rsignal_state|int i
-p |void |rxres_free |NN void** rsp
-p |void |rxres_restore |NN void **rsp|NN REGEXP *rx
+#if defined(PERL_IN_PP_CTL_C)
+s |void |rxres_free |NN void** rsp
+s |void |rxres_restore |NN void **rsp|NN REGEXP *rx
+#endif
+: Used in pp_hot.c
p |void |rxres_save |NN void **rsp|NN REGEXP *rx
#if !defined(HAS_RENAME)
p |I32 |same_dirent |NN const char* a|NN const char* b
diff --git a/embed.h b/embed.h
index b5911b695e..18847707e3 100644
--- a/embed.h
+++ b/embed.h
@@ -758,9 +758,13 @@
#define rsignal_save Perl_rsignal_save
#endif
#define rsignal_state Perl_rsignal_state
+#if defined(PERL_IN_PP_CTL_C)
+#ifdef PERL_CORE
+#define rxres_free S_rxres_free
+#define rxres_restore S_rxres_restore
+#endif
+#endif
#ifdef PERL_CORE
-#define rxres_free Perl_rxres_free
-#define rxres_restore Perl_rxres_restore
#define rxres_save Perl_rxres_save
#endif
#if !defined(HAS_RENAME)
@@ -3102,9 +3106,13 @@
#define rsignal_save(a,b,c) Perl_rsignal_save(aTHX_ a,b,c)
#endif
#define rsignal_state(a) Perl_rsignal_state(aTHX_ a)
+#if defined(PERL_IN_PP_CTL_C)
+#ifdef PERL_CORE
+#define rxres_free(a) S_rxres_free(aTHX_ a)
+#define rxres_restore(a,b) S_rxres_restore(aTHX_ a,b)
+#endif
+#endif
#ifdef PERL_CORE
-#define rxres_free(a) Perl_rxres_free(aTHX_ a)
-#define rxres_restore(a,b) Perl_rxres_restore(aTHX_ a,b)
#define rxres_save(a,b) Perl_rxres_save(aTHX_ a,b)
#endif
#if !defined(HAS_RENAME)
diff --git a/pp_ctl.c b/pp_ctl.c
index 8e89cb9a72..c8d5a3ec3b 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -357,8 +357,8 @@ Perl_rxres_save(pTHX_ void **rsp, REGEXP *rx)
}
}
-void
-Perl_rxres_restore(pTHX_ void **rsp, REGEXP *rx)
+static void
+S_rxres_restore(pTHX_ void **rsp, REGEXP *rx)
{
UV *p = (UV*)*rsp;
U32 i;
@@ -387,8 +387,8 @@ Perl_rxres_restore(pTHX_ void **rsp, REGEXP *rx)
}
}
-void
-Perl_rxres_free(pTHX_ void **rsp)
+static void
+S_rxres_free(pTHX_ void **rsp)
{
UV * const p = (UV*)*rsp;
diff --git a/proto.h b/proto.h
index 18071f8161..30faee8f35 100644
--- a/proto.h
+++ b/proto.h
@@ -2705,17 +2705,19 @@ PERL_CALLCONV int Perl_rsignal_save(pTHX_ int i, Sighandler_t t1, Sigsave_t* sav
assert(save)
PERL_CALLCONV Sighandler_t Perl_rsignal_state(pTHX_ int i);
-PERL_CALLCONV void Perl_rxres_free(pTHX_ void** rsp)
+#if defined(PERL_IN_PP_CTL_C)
+STATIC void S_rxres_free(pTHX_ void** rsp)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_RXRES_FREE \
assert(rsp)
-PERL_CALLCONV void Perl_rxres_restore(pTHX_ void **rsp, REGEXP *rx)
+STATIC void S_rxres_restore(pTHX_ void **rsp, REGEXP *rx)
__attribute__nonnull__(pTHX_1)
__attribute__nonnull__(pTHX_2);
#define PERL_ARGS_ASSERT_RXRES_RESTORE \
assert(rsp); assert(rx)
+#endif
PERL_CALLCONV void Perl_rxres_save(pTHX_ void **rsp, REGEXP *rx)
__attribute__nonnull__(pTHX_1)
__attribute__nonnull__(pTHX_2);