summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2004-10-15 17:11:08 +0000
committerNicholas Clark <nick@ccl4.org>2004-10-15 17:11:08 +0000
commit5fcdf167f4386a3583bf0db9d98b989639295a45 (patch)
tree196d537a9c2aae33aea4f0c2500053b34fc83295 /sv.h
parent2cbb2ee1d6d1dc9f375107de4b70573ece8a4e13 (diff)
downloadperl-5fcdf167f4386a3583bf0db9d98b989639295a45.tar.gz
Implement sv_svset _nosteal variants by passing a flag into
sv_set_flags rather than messing with the SvTEMP() flag on either side of the call. p4raw-id: //depot/perl@23373
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/sv.h b/sv.h
index c26da9d96b..e80c755704 100644
--- a/sv.h
+++ b/sv.h
@@ -1103,6 +1103,7 @@ Like C<sv_catsv> but doesn't process magic.
#define SV_GMAGIC 2
#define SV_COW_DROP_PV 4
#define SV_UTF8_NO_ENCODING 8
+#define SV_NOSTEAL 16
/* We are about to replace the SV's current value. So if it's copy on write
we need to normalise it. Use the SV_COW_DROP_PV flag hint to say that
@@ -1242,10 +1243,7 @@ Returns a pointer to the character buffer.
#define SvSetSV_nosteal_and(dst,src,finally) \
STMT_START { \
if ((dst) != (src)) { \
- U32 tMpF = SvFLAGS(src) & SVs_TEMP; \
- SvTEMP_off(src); \
- sv_setsv(dst, src); \
- SvFLAGS(src) |= tMpF; \
+ sv_setsv_flags(dst, src, SV_GMAGIC | SV_NOSTEAL); \
finally; \
} \
} STMT_END