develooper Front page | perl.perl5.porters | Postings from February 2017

Re: Apparent 4 avail bits in SV flags

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
February 9, 2017 21:07
Subject:
Re: Apparent 4 avail bits in SV flags
Message ID:
CAHhgV8izUOdOqYZLQRrPZps3XWcygXFNxg_xp=O=c7GD5m8EAQ@mail.gmail.com
On Thu, Feb 9, 2017 at 1:29 AM, Karl Williamson <public@khwilliamson.com>
wrote:

> It looks to me, and others on #p5p that there are 4 unused bits in the
> flags for an SV.
>
> The types take up 4 bits, but then the actual flags, like SVf_IOK, start
> at 0x100.  That apparently means bits  matching the mask 0xF0 are
> available.  Are we wrong?
>

"He guessed as well as he could, and crawled along for a good way, till
suddenly his hand met what felt like a tiny ring of cold metal lying on the
floor of the tunnel. It was a turning point in his career, but he did not
know it. He put the ring in his pocket almost without thinking; certainly
it did not seem of any particular use at the moment." - Riddles in the Dark
- The Hobbit

The other bits are actually used in one condition: to mark the SV as freed
SvTYPE is set to 0xFF. Other than that, the bits are indeed unused. They're
probably the most precious bits we have in perl, given that everyone wants
flag bits for their favorite feature.

Leon
Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About