develooper Front page | perl.perl5.porters | Postings from August 2021

SV flags tidying

Thread Next
Paul "LeoNerd" Evans
August 7, 2021 00:50
SV flags tidying
Message ID:
I've started a branch to tidy up some edges around the SvFLAGS

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

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      |  |

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About