I've started a branch to tidy up some edges around the SvFLAGS
constants.
https://github.com/leonerd/perl5/tree/sv-flags-tidy
So far I've:
*) Created SVphv_HASAUX as an alias of SVf_OOK, so the flag/macro is
named less confusingly there
*) Renamed SVf_AMAGIC to SVphv_AMAGIC because it's only applied to
stashes
I've also noticed that the SVp_SCREAM bit is currently not used on
regular scalars except SvROK ones, and the SVf_IVisUV bit is only used
on numerical (non-referential) scalars. I'm now testing a change to
move that latter bit out from its own current position, into the same
value as SVp_SCREAM. If this works, that will give us two spare free
bits on regular scalars, conveniently right next to the SVf_UTF8 bit.
We'll need two spare bits here if we want to track UNKNOWN|BYTES|TEXT
state of strings.
I imagine there probably isn't any compatibility problem with changing
the value of a flag bit, but perhaps to be on the safe side, if people
think it best, I might give it new name while I'm moving it. Since it
only applies (privately) to non-reference scalars, perhaps it should be
called SVp_IVisUV instead?
It's possible that SVprv_WEAKREF will also get in the way here, and if
so I may have to change its value too, but again the same compat
questions apply.
Thoughts, anyone?
--
Paul "LeoNerd" Evans
leonerd@leonerd.org.uk | https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/ | https://www.tindie.com/stores/leonerd/
constants.
https://github.com/leonerd/perl5/tree/sv-flags-tidy
So far I've:
*) Created SVphv_HASAUX as an alias of SVf_OOK, so the flag/macro is
named less confusingly there
*) Renamed SVf_AMAGIC to SVphv_AMAGIC because it's only applied to
stashes
I've also noticed that the SVp_SCREAM bit is currently not used on
regular scalars except SvROK ones, and the SVf_IVisUV bit is only used
on numerical (non-referential) scalars. I'm now testing a change to
move that latter bit out from its own current position, into the same
value as SVp_SCREAM. If this works, that will give us two spare free
bits on regular scalars, conveniently right next to the SVf_UTF8 bit.
We'll need two spare bits here if we want to track UNKNOWN|BYTES|TEXT
state of strings.
I imagine there probably isn't any compatibility problem with changing
the value of a flag bit, but perhaps to be on the safe side, if people
think it best, I might give it new name while I'm moving it. Since it
only applies (privately) to non-reference scalars, perhaps it should be
called SVp_IVisUV instead?
It's possible that SVprv_WEAKREF will also get in the way here, and if
so I may have to change its value too, but again the same compat
questions apply.
Thoughts, anyone?
--
Paul "LeoNerd" Evans
leonerd@leonerd.org.uk | https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/ | https://www.tindie.com/stores/leonerd/