Both newSVsv() and newSVsv_nomg() are now implemented via new Perl_newSVsv_flags() function.
AfpdR |SV* |newSVpvf |NN const char *const pat|...
ApR |SV* |vnewSVpvf |NN const char *const pat|NULLOK va_list *const args
Apd |SV* |newSVrv |NN SV *const rv|NULLOK const char *const classname
-ApdR |SV* |newSVsv |NULLOK SV *const old
+ApmbdR |SV* |newSVsv |NULLOK SV *const old
+ApmdR |SV* |newSVsv_nomg |NULLOK SV *const old
+ApR |SV* |newSVsv_flags |NULLOK SV *const old|I32 flags
ApdR |SV* |newSV_type |const svtype type
ApdR |OP* |newUNOP |I32 type|I32 flags|NULLOK OP* first
ApdR |OP* |newUNOP_AUX |I32 type|I32 flags|NULLOK OP* first \
#define newSVpvn_flags(a,b,c) Perl_newSVpvn_flags(aTHX_ a,b,c)
#define newSVpvn_share(a,b,c) Perl_newSVpvn_share(aTHX_ a,b,c)
#define newSVrv(a,b) Perl_newSVrv(aTHX_ a,b)
-#define newSVsv(a) Perl_newSVsv(aTHX_ a)
+#define newSVsv_flags(a,b) Perl_newSVsv_flags(aTHX_ a,b)
#define newSVuv(a) Perl_newSVuv(aTHX_ a)
#define newUNOP(a,b,c) Perl_newUNOP(aTHX_ a,b,c)
#define newUNOP_AUX(a,b,c,d) Perl_newUNOP_AUX(aTHX_ a,b,c,d)
return instr((char *) big, (char *) little);
}
+SV *
+Perl_newSVsv(pTHX_ SV *const old)
+{
+ return newSVsv(old);
+}
+
#endif /* NO_MATHOMS */
/*
PERL_CALLCONV SV* Perl_newSVrv(pTHX_ SV *const rv, const char *const classname);
#define PERL_ARGS_ASSERT_NEWSVRV \
assert(rv)
+#ifndef NO_MATHOMS
PERL_CALLCONV SV* Perl_newSVsv(pTHX_ SV *const old)
__attribute__warn_unused_result__;
+#endif
+
+PERL_CALLCONV SV* Perl_newSVsv_flags(pTHX_ SV *const old, I32 flags)
+ __attribute__warn_unused_result__;
+
+/* PERL_CALLCONV SV* Perl_newSVsv_nomg(pTHX_ SV *const old)
+ __attribute__warn_unused_result__; */
PERL_CALLCONV SV* Perl_newSVuv(pTHX_ const UV u)
__attribute__warn_unused_result__;
Creates a new SV which is an exact duplicate of the original SV.
(Uses C<sv_setsv>.)
+=for apidoc newSVsv_nomg
+
+Like C<newSVsv> but does not process get magic.
+
=cut
*/
SV *
-Perl_newSVsv(pTHX_ SV *const old)
+Perl_newSVsv_flags(pTHX_ SV *const old, I32 flags)
{
SV *sv;
return NULL;
}
/* Do this here, otherwise we leak the new SV if this croaks. */
- SvGETMAGIC(old);
+ if (flags & SV_GMAGIC)
+ SvGETMAGIC(old);
new_SV(sv);
- /* SV_NOSTEAL prevents TEMP buffers being, well, stolen, and saves games
- with SvTEMP_off and SvTEMP_on round a call to sv_setsv. */
- sv_setsv_flags(sv, old, SV_NOSTEAL);
+ sv_setsv_flags(sv, old, flags & ~SV_GMAGIC);
return sv;
}
AV *unreferenced;
};
+/* SV_NOSTEAL prevents TEMP buffers being, well, stolen, and saves games
+ with SvTEMP_off and SvTEMP_on round a call to sv_setsv. */
+#define newSVsv(sv) newSVsv_flags((sv), SV_GMAGIC|SV_NOSTEAL)
+#define newSVsv_nomg(sv) newSVsv_flags((sv), SV_NOSTEAL)
+
/*
=for apidoc Am|SV*|newSVpvn_utf8|const char* s|STRLEN len|U32 utf8