summaryrefslogtreecommitdiff
path: root/gv.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-06-29 15:58:14 +0000
committerNicholas Clark <nick@ccl4.org>2005-06-29 15:58:14 +0000
commitc69033f2a629160559f680da8e4e5a7e3c4c3a0c (patch)
treed19b6ca86b0f5cbbbb1e078ab96eac111df03dfd /gv.h
parent9dc0b5dcb80b5128172acb8c4bd670aa72142821 (diff)
downloadperl-c69033f2a629160559f680da8e4e5a7e3c4c3a0c.tar.gz
First stab at not automatically creating an unused SV for GvSV
Enable it with -DPERL_DONT_CREATE_GVSV. Currently if enabled 22 test scripts have failures, so still some way to go. p4raw-id: //depot/perl@25009
Diffstat (limited to 'gv.h')
-rw-r--r--gv.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/gv.h b/gv.h
index c02051051f..d59307a400 100644
--- a/gv.h
+++ b/gv.h
@@ -42,6 +42,14 @@ Return the SV from the GV.
*/
#define GvSV(gv) (GvGP(gv)->gp_sv)
+#ifdef PERL_DONT_CREATE_GVSV
+#define GvSVn(gv) (GvGP(gv)->gp_sv ? \
+ GvGP(gv)->gp_sv : \
+ GvGP(gv_SVadd(gv))->gp_sv)
+#else
+#define GvSVn(gv) GvSV(gv)
+#endif
+
#define GvREFCNT(gv) (GvGP(gv)->gp_refcnt)
#define GvIO(gv) ((gv) && SvTYPE((SV*)gv) == SVt_PVGV && GvGP(gv) ? GvIOp(gv) : 0)
#define GvIOp(gv) (GvGP(gv)->gp_io)