summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embed.fnc2
-rw-r--r--embed.h2
-rw-r--r--inline.h8
-rw-r--r--proto.h10
4 files changed, 20 insertions, 2 deletions
diff --git a/embed.fnc b/embed.fnc
index 19e79f52cd..d89dc1489a 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -2261,6 +2261,8 @@ AiTMdp |SV * |SvREFCNT_inc_NN|NN SV *sv
AiTMdp |void |SvREFCNT_inc_void|NULLOK SV *sv
AiMdp |void |SvREFCNT_dec |NULLOK SV *sv
AiMdp |void |SvREFCNT_dec_NN|NN SV *sv
+AiTp |void |SvAMAGIC_on |NN SV *sv
+AiTp |void |SvAMAGIC_off |NN SV *sv
: This is indirectly referenced by globals.c. This is somewhat annoying.
p |int |magic_killbackrefs|NN SV *sv|NN MAGIC *mg
Ap |OP* |newANONATTRSUB |I32 floor|NULLOK OP *proto|NULLOK OP *attrs|NULLOK OP *block
diff --git a/embed.h b/embed.h
index c1c3e85339..6bbbbe410e 100644
--- a/embed.h
+++ b/embed.h
@@ -27,6 +27,8 @@
/* Hide global symbols */
#define Gv_AMupdate(a,b) Perl_Gv_AMupdate(aTHX_ a,b)
+#define SvAMAGIC_off Perl_SvAMAGIC_off
+#define SvAMAGIC_on Perl_SvAMAGIC_on
#define _force_out_malformed_utf8_message(a,b,c,d) Perl__force_out_malformed_utf8_message(aTHX_ a,b,c,d)
#define _is_uni_FOO(a,b) Perl__is_uni_FOO(aTHX_ a,b)
#define _is_uni_perl_idcont(a) Perl__is_uni_perl_idcont(aTHX_ a)
diff --git a/inline.h b/inline.h
index 5bae44e2bd..a63feedb95 100644
--- a/inline.h
+++ b/inline.h
@@ -239,14 +239,18 @@ Perl_SvREFCNT_dec_NN(pTHX_ SV *sv)
}
PERL_STATIC_INLINE void
-SvAMAGIC_on(SV *sv)
+Perl_SvAMAGIC_on(SV *sv)
{
+ PERL_ARGS_ASSERT_SVAMAGIC_ON;
assert(SvROK(sv));
+
if (SvOBJECT(SvRV(sv))) HvAMAGIC_on(SvSTASH(SvRV(sv)));
}
PERL_STATIC_INLINE void
-SvAMAGIC_off(SV *sv)
+Perl_SvAMAGIC_off(SV *sv)
{
+ PERL_ARGS_ASSERT_SVAMAGIC_OFF;
+
if (SvROK(sv) && SvOBJECT(SvRV(sv)))
HvAMAGIC_off(SvSTASH(SvRV(sv)));
}
diff --git a/proto.h b/proto.h
index 8d74d66eac..6e1329662c 100644
--- a/proto.h
+++ b/proto.h
@@ -74,6 +74,16 @@ PERL_CALLCONV void Perl_Slab_Free(pTHX_ void *op);
#define PERL_ARGS_ASSERT_SLAB_FREE \
assert(op)
#ifndef PERL_NO_INLINE_FUNCTIONS
+PERL_STATIC_INLINE void Perl_SvAMAGIC_off(SV *sv);
+#define PERL_ARGS_ASSERT_SVAMAGIC_OFF \
+ assert(sv)
+#endif
+#ifndef PERL_NO_INLINE_FUNCTIONS
+PERL_STATIC_INLINE void Perl_SvAMAGIC_on(SV *sv);
+#define PERL_ARGS_ASSERT_SVAMAGIC_ON \
+ assert(sv)
+#endif
+#ifndef PERL_NO_INLINE_FUNCTIONS
PERL_STATIC_INLINE void Perl_SvREFCNT_dec(pTHX_ SV *sv);
#define PERL_ARGS_ASSERT_SVREFCNT_DEC
#endif