diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-05-03 21:46:02 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-05-03 21:46:02 +0000 |
commit | 952306aca140c014b38ba5eb2ed71dffaa548f0f (patch) | |
tree | 54c6ffddc042f5b62b93fed63bf59ac25dcd59d9 /sv.h | |
parent | d8c3cb99cb05a7cc157c615db679022cae30abb4 (diff) | |
download | perl-952306aca140c014b38ba5eb2ed71dffaa548f0f.tar.gz |
Introduce a new keyword, state, for state variables.
p4raw-id: //depot/perl@28086
Diffstat (limited to 'sv.h')
-rw-r--r-- | sv.h | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -284,6 +284,7 @@ perform the upgrade if necessary. See C<svtype>. #define SVphv_CLONEABLE 0x00008000 /* PVHV (stashes) clone its objects */ #define SVs_PADSTALE 0x00010000 /* lexical has gone out of scope */ +#define SVpad_STATE 0x00010000 /* pad name is a "state" var */ #define SVs_PADTMP 0x00020000 /* in use as tmp */ #define SVpad_TYPED 0x00020000 /* pad name is a Typed Lexical */ #define SVs_PADMY 0x00040000 /* in use a "my" variable */ @@ -339,7 +340,8 @@ perform the upgrade if necessary. See C<svtype>. keys live on shared string table */ /* PVNV, PVMG, PVGV, presumably only inside pads */ #define SVpad_NAME 0x40000000 /* This SV is a name in the PAD, so - SVpad_TYPED and SVpad_OUR apply */ + SVpad_TYPED, SVpad_OUR and + SVpad_STATE apply */ /* PVAV */ #define SVpav_REAL 0x40000000 /* free old entries */ /* PVHV */ @@ -1074,6 +1076,10 @@ the scalar's value cannot change unless written to. ((SvFLAGS(sv) & (SVpad_NAME|SVpad_OUR)) == (SVpad_NAME|SVpad_OUR)) #define SvPAD_OUR_on(sv) (SvFLAGS(sv) |= SVpad_NAME|SVpad_OUR) +#define SvPAD_STATE(sv) \ + ((SvFLAGS(sv) & (SVpad_NAME|SVpad_STATE)) == (SVpad_NAME|SVpad_STATE)) +#define SvPAD_STATE_on(sv) (SvFLAGS(sv) |= SVpad_NAME|SVpad_STATE) + #define OURSTASH(sv) \ (SvPAD_OUR(sv) ? ((XPVMG*) SvANY(sv))->xmg_u.xmg_ourstash : NULL) #define OURSTASH_set(sv, st) \ |