summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-05-10 19:33:36 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-05-10 19:33:36 +0000
commit810b8aa5436a934d1a2016588cbacf9b55463c40 (patch)
treeeabed90b74c878cc77d9ec21c13c0263fcc798a1 /sv.h
parent885f9e59968d66740b5c621739ead374e8e37a2b (diff)
downloadperl-810b8aa5436a934d1a2016588cbacf9b55463c40.tar.gz
"weak" references internals, still needs perlguts documentation
(somewhat modified version of patch suggested by Tuomas J. Lukka <lukka@fas.harvard.edu>) p4raw-id: //depot/perl@3385
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sv.h b/sv.h
index 533b4c4a46..cc8c6bc936 100644
--- a/sv.h
+++ b/sv.h
@@ -165,6 +165,8 @@ struct io {
#define SVphv_SHAREKEYS 0x20000000 /* keys live on shared string table */
#define SVphv_LAZYDEL 0x40000000 /* entry in xhv_eiter must be deleted */
+#define SVprv_WEAKREF 0x80000000 /* Weak reference */
+
struct xrv {
SV * xrv_rv; /* pointer to another SV */
};
@@ -410,6 +412,11 @@ struct xpvio {
*/
#define Gv_AMG(stash) (PL_amagic_generation && Gv_AMupdate(stash))
+#define SvWEAKREF(sv) ((SvFLAGS(sv) & (SVf_ROK|SVprv_WEAKREF)) \
+ == (SVf_ROK|SVprv_WEAKREF))
+#define SvWEAKREF_on(sv) (SvFLAGS(sv) |= (SVf_ROK|SVprv_WEAKREF))
+#define SvWEAKREF_off(sv) (SvFLAGS(sv) &= ~(SVf_ROK|SVprv_WEAKREF))
+
#define SvTHINKFIRST(sv) (SvFLAGS(sv) & SVf_THINKFIRST)
#define SvPADBUSY(sv) (SvFLAGS(sv) & SVs_PADBUSY)