diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-05-10 19:33:36 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-05-10 19:33:36 +0000 |
commit | 810b8aa5436a934d1a2016588cbacf9b55463c40 (patch) | |
tree | eabed90b74c878cc77d9ec21c13c0263fcc798a1 /sv.h | |
parent | 885f9e59968d66740b5c621739ead374e8e37a2b (diff) | |
download | perl-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.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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) |