summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorPali <pali@cpan.org>2019-02-07 14:10:35 +0100
committerTony Cook <tony@develop-help.com>2019-02-25 10:17:20 +1100
commit238f2c136aa0ab2a1070f175ec56ef61b91ff79d (patch)
treea26c69376275007668459851661f8f1793bfacd9 /sv.h
parent929e53be972b0c811eca54a3c7017db116f62e4a (diff)
downloadperl-238f2c136aa0ab2a1070f175ec56ef61b91ff79d.tar.gz
Add newSVsv_nomg() macro which is like newSVsv() but does not process get magic
Both newSVsv() and newSVsv_nomg() are now implemented via new Perl_newSVsv_flags() function.
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sv.h b/sv.h
index f3392b08ec..3a648e4971 100644
--- a/sv.h
+++ b/sv.h
@@ -2175,6 +2175,11 @@ struct clone_params {
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