summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
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)